<div dir="ltr">Hi everyone,<div><br></div><div>I am trying to create an interactive "plot: where users can select a subset of the data, and based on the selection, a variable number of additional plots is added. </div><div>When the user changes the selection, the number of plots is increased or decreased accordingly.</div><div>I am using a vtkAnnotationLink and a vtkCommand subclass to trigger the update of the vtkChartMatrix that contains all the plots. </div><div><br></div><div>My problem is that I am experiencing non-deterministic crashes in my application, which occur deep within the garbage collection following a call of the destructor of a vtkPlotPoints object. </div><div>What causes the crash is that the "first" IVar of the iterator is a nullpointer.</div><div><br></div><div><div>void vtkInformation::ReportReferences(vtkGarbageCollector* collector)</div><div>{</div><div>  this->Superclass::ReportReferences(collector);</div><div>  // Ask each key/value pair to report any references it holds.</div><div>  typedef vtkInformationInternals::MapType MapType;</div><div>  for(MapType::const_iterator i = this->Internal->Map.begin();</div><div>      i != this->Internal->Map.end(); ++i)</div><div>    {</div><div>    i->first->Report(this, collector);</div><div>    }</div><div>}</div></div><div><br></div><div><br></div><div>I think that the problem is stemming from the qt eventloop triggering a redraw while I am updating the plot (which involves the destruction and creation of  vtkPlots in the vtkChartMatrix).</div><div><br></div><div>I have following questions:</div><div>What calls are necessary to remove a scene from the renderer, in such a way that I can destroy items in the scene safely?</div><div>Or more general; which manipulations of a plot/chart/scene are safe in an interactive setting, where a GUI thread my trigger redraws at any time?</div><div>Is there a better way than simply duplicating the QVTKWidget and switching between two widgets when updating the scene (manually setting mutexes in the Qt and vtk sub-classes seems like a bad idea since this would depend on implementation details, both in Qt and Vtk)?</div><div><br></div><div>Thanks,</div><div>Bastian</div><div><br></div><div><br></div><div><br></div></div>