mirror of
https://github.com/OPM/ResInsight.git
synced 2026-11-02 09:00:14 -06:00
Use deleteLater
Uses deleteLater to avoid issues when deleting radio buttons from signal handlers, resolving a crash observed during focus changes.
This commit is contained in:
1 parent
e71172fa39
commit
c035c31a0d
1 file changed
+2
-1
@@ -208,11 +208,12 @@ void PdmUiRadioButtonEditor::updateRadioButtons()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmUiRadioButtonEditor::clearRadioButtons()
|
||||
{
|
||||
// Use deleteLater to avoid issues if called from signal handlers. Crash has been observed during focus changes.
|
||||
for ( QRadioButton* radioButton : m_radioButtons )
|
||||
{
|
||||
if ( radioButton )
|
||||
{
|
||||
delete radioButton;
|
||||
radioButton->deleteLater();
|
||||
}
|
||||
}
|
||||
m_radioButtons.clear();
|
||||
|
||||
Reference in new issue
Block a user