Skip to content

Commit

Permalink
9939 Temporary fix for crash situation
Browse files Browse the repository at this point in the history
Crash is seen on application exit
  • Loading branch information
magnesj committed Mar 16, 2023
1 parent 164cc1e commit a7108f0
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions Fwk/AppFwk/cafUserInterface/cafPdmUiFormLayoutObjectEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,11 +492,25 @@ void caf::PdmUiFormLayoutObjectEditor::cleanupBeforeSettingPdmObject()

m_groupBoxes.clear();

for ( auto l : m_layouts )
{
delete l;
l = nullptr;
}
// https://github.com/OPM/ResInsight/issues/9939
//
// The following lines causes crash. m_layouts contains pointers to layouts that are invalid at this point. The
// m_layouts are created for widgets where the labels are located on top of the widget, and this option is rarely
// used. The crash happens on exit every time when a layout has been created.
//
// A crash has also happened during runtime, but is hard to reproduce.
//
// NB! There will be memory leak at this point, but the workaround allowing memory leak is considered OK on short
// term. Investigate and find a correct solution
//
/*
for ( auto l : m_layouts )
{
delete l;
l = nullptr;
}
*/

m_layouts.clear();
}

Expand Down

0 comments on commit a7108f0

Please sign in to comment.