]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To provide correct memory menagement
authorapo <apo@opencascade.com>
Tue, 13 Sep 2005 04:13:59 +0000 (04:13 +0000)
committerapo <apo@opencascade.com>
Tue, 13 Sep 2005 04:13:59 +0000 (04:13 +0000)
So, all descendant of SVTK package should not do care about memory management.
Only simple pointers should be stored (do not use any smart pointers).
The VTK's RenderWindow/Renderer/RenderWindowInteractor/InteractorStyle classes have close conversation and should be destroyed in strict order. Therefore all the memory manemgemnt code was moved to corresponding basic classes.

src/VVTK/VVTK_Renderer.h
src/VVTK/VVTK_View.cxx
src/VVTK/VVTK_View.h

index 19251827a131a55894d1e7dd34127415f7e4fbc1..bb6ff97a9956b5382479f91028d59dc7b4500367 100644 (file)
@@ -102,8 +102,8 @@ class VVTK_EXPORT VVTK_Renderer2 : public SVTK_Renderer
   float myPriority;
 
   vtkSmartPointer<vtkImplicitPlaneWidget> myImplicitPlaneWidget1;
-  vtkSmartPointer<VVTK_Renderer1> myRenderer1;
   vtkSmartPointer<vtkPlane> myFunction;
+  VVTK_Renderer1* myRenderer1;
 };
 
 
index a38065d8da15d7939e239dcb89469543743ac6dd..bab23772512f5f8a5796dee91c56f4c5a6524e06 100644 (file)
@@ -147,7 +147,7 @@ VVTK_MainWindow1
 ::Initialize()
 {
   myRenderer = VVTK_Renderer1::New();
-  VVTK_MainWindowBase::Initialize(myRenderer.GetPointer());
+  VVTK_MainWindowBase::Initialize(myRenderer);
   myRenderer->Delete();
 }
 
@@ -161,7 +161,7 @@ VVTK_Renderer1*
 VVTK_MainWindow1
 ::GetRenderer1()
 {
-  return myRenderer.GetPointer();
+  return myRenderer;
 }
 
 //----------------------------------------------------------------------------
@@ -202,7 +202,7 @@ VVTK_MainWindow2
 ::Initialize()
 {
   myRenderer = VVTK_Renderer2::New();
-  VVTK_MainWindowBase::Initialize(myRenderer.GetPointer());
+  VVTK_MainWindowBase::Initialize(myRenderer);
   myRenderer->Delete();
 
   myRenderer->SetRenderer1(myMainWindow->GetRenderer1());
index af8544ea41767a100b6e167a42e5d2d35a64d7a8..65987b95b0adc3edc77b2a88f609bb81f83e4a5c 100644 (file)
@@ -64,7 +64,7 @@ public:
   void OnPlaneSegmentationSwitch(bool theIsPlaneSegmentationOn); 
 
  protected:
-  vtkSmartPointer<VVTK_Renderer1> myRenderer;
+  VVTK_Renderer1* myRenderer;
 };
 
 
@@ -92,7 +92,7 @@ public:
 
  protected:
   VVTK_MainWindow1* myMainWindow;
-  vtkSmartPointer<VVTK_Renderer2> myRenderer;
+  VVTK_Renderer2* myRenderer;
 };