@@ -95,36 +95,9 @@ MyViz::MyViz( QWidget* parent )
95
95
cell_size_slider->setValue ( 10 );
96
96
}
97
97
98
- // Destructor for MyViz. The complexity here is something I would
99
- // like to avoid in future versions.
100
- //
101
- // Removing all the displays first is not technically required for
102
- // this example, but if we used a PropertyTreeWidget it would be
103
- // required, so it is a good idea.
104
- //
105
- // It would be required because Display objects own Properties, and
106
- // Properties own children of PropertyTreeWidget
107
- // (PropertyWidgetItems). PropertyTreeWidget notices when
108
- // PropertyWidgetItems are destroyed, but Properties don't notice when
109
- // PropertyWidgetItems are destroyed, so must destroy from the Display
110
- // (and thus Property) side first.
111
- //
112
- // The ``render_panel_`` is a child widget of MyViz and so would be
113
- // deleted naturally by the QWidget destructor, but that would be
114
- // after we deleted ``manager_``. Instead we must delete
115
- // ``render_panel_`` *before* ``manager_`` because
116
- // ``~VisualizationManager()`` destroys ogre SceneManager which
117
- // destroys all attached SceneNodes. RenderPanel indirectly holds
118
- // pointers to SceneNodes which it destroys. RenderPanel doesn't know
119
- // when Ogre destroys its SceneNodes, so RenderPanel would cause a
120
- // segfault during its destructor.
98
+ // Destructor.
121
99
MyViz::~MyViz ()
122
100
{
123
- if ( manager_ != NULL )
124
- {
125
- manager_->removeAllDisplays ();
126
- }
127
- delete render_panel_;
128
101
delete manager_;
129
102
}
130
103
0 commit comments