Commit 2b9fe599 authored by Brad King's avatar Brad King
Browse files

BUG: ClassFinalize should set vtkGarbageCollectorSingletonInstance to NULL so...

BUG: ClassFinalize should set vtkGarbageCollectorSingletonInstance to NULL so that destruction of other singletons that collect VTK objects do not try to defer collection in a deleted singleton.
parent b87cceb9
......@@ -35,7 +35,7 @@
#include <assert.h>
vtkCxxRevisionMacro(vtkGarbageCollector, "1.28");
vtkCxxRevisionMacro(vtkGarbageCollector, "1.29");
vtkStandardNewMacro(vtkGarbageCollector);
#if VTK_GARBAGE_COLLECTOR_HASH
......@@ -868,8 +868,14 @@ void vtkGarbageCollector::ClassInitialize()
//----------------------------------------------------------------------------
void vtkGarbageCollector::ClassFinalize()
{
// We are done with the singleton.
// We are done with the singleton. Delete it and reset the pointer.
// Other singletons may still cause garbage collection of VTK
// objects, they just will not have the option of deferred
// collection. In order to get it they need only to include
// vtkGarbageCollectorManager.h so that this singleton stays around
// longer.
delete vtkGarbageCollectorSingletonInstance;
vtkGarbageCollectorSingletonInstance = 0;
}
//----------------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment