]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx
*** empty log message ***
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / wxVtk3DBaseView.cxx
index e601235c1bd8365c71b97f8b75ada2c789334f05..3722c50fc2a985278d3031e1a6fa9c57ce0134f8 100644 (file)
@@ -14,9 +14,14 @@ wxVtk3DBaseView::wxVtk3DBaseView(wxWindow *parent)
 //-------------------------------------------------------------------
 wxVtk3DBaseView::~wxVtk3DBaseView()
 {
-       if (_aCamera!=NULL)     { _aCamera              -> Delete(); }
-       if (_aRenderer!=NULL)   { _aRenderer    -> Delete(); }
-       if (_renWin!=NULL)      { _renWin               -> Delete(); }
+
+       if (_aCamera!=NULL)     { _aCamera              -> Delete(); _aCamera=NULL;}
+       if (_aRenderer!=NULL)   { _aRenderer    -> Delete(); _aRenderer=NULL;}
+       if (_renWin!=NULL)      { 
+               if(_renWin->GetReferenceCount()==0){
+                       _renWin         -> Delete(); _renWin=NULL;
+               }
+       }
 }
 //-------------------------------------------------------------------
 vtkCamera* wxVtk3DBaseView::GetCamera()
@@ -43,8 +48,10 @@ void wxVtk3DBaseView::Refresh()
 //-------------------------------------------------------------------
 void wxVtk3DBaseView::Configure()
 {
+       printf("EED wxVtk3DBaseView::Configure A\n");
        if (_configure==false)
        {
+       printf("EED wxVtk3DBaseView::Configure B\n");
                _configure=true;
                //wxVtkBaseView::Configure();
                _aRenderer      = vtkRenderer::New();