From: vsr Date: Wed, 16 Nov 2005 08:31:50 +0000 (+0000) Subject: Fix a bug: close() method of data model is not called X-Git-Tag: V3_1_0a3~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c15194ded2db40779df2173e0f6b40872f650903;p=modules%2Fgui.git Fix a bug: close() method of data model is not called --- diff --git a/src/CAM/CAM_Module.cxx b/src/CAM/CAM_Module.cxx index 4e18bff8f..54a0e118a 100755 --- a/src/CAM/CAM_Module.cxx +++ b/src/CAM/CAM_Module.cxx @@ -129,8 +129,11 @@ void CAM_Module::studyClosed( SUIT_Study* study ) if ( !camDoc ) return; - if ( camDoc->containsDataModel( dataModel() ) ) - camDoc->removeDataModel( dataModel() ); + CAM_DataModel* dm = dataModel(); + if ( dm && camDoc->containsDataModel( dm ) ) { + dm->close(); + camDoc->removeDataModel( dm ); + } } /*!Public slot, do nothing.*/