From: tbaudier Date: Mon, 4 Mar 2019 15:49:12 +0000 (+0100) Subject: Better control to avoid segfault X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=bffde3a7ae834139793d8c00f73986879146b0e0;p=clitk.git Better control to avoid segfault With one input, the accept function is called 3 times instead of 2 (I do not know why) It leads to a segfault in mListOfSimpleInputWidget[3] so to avoid it I added a check --- diff --git a/vv/vvToolInputSelectorWidget.cxx b/vv/vvToolInputSelectorWidget.cxx index 82110f0..ca1ed29 100644 --- a/vv/vvToolInputSelectorWidget.cxx +++ b/vv/vvToolInputSelectorWidget.cxx @@ -90,7 +90,7 @@ void vvToolInputSelectorWidget::accept() if (mNumberOfAcceptedInputs == GetNumberOfInput()) { setEnabled(false); emit accepted(); - } else { + } else if (mNumberOfAcceptedInputs < GetNumberOfInput()) { mListOfSimpleInputWidget[mNumberOfAcceptedInputs]->setEnabled(true); } }