vtk crash on shutdown with release build and debug leaks
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
In a release build with vtk debug leaks on in Windows.....
VTK has static objects instantiated in separate object files that depend on each other. So the order of cleanup is important. However, the linker makes no guarentee of the order of static object cleanup if they are in separate object files. So vtkDebugLeaks is being invoked from vtkCleanUpObjectFactory, but vtkDebugLeaks has already been destroyed. Which results in a crash when trying to lock the NULL critical section.
This problem is why there is a popup window that reports one leak, which is the vtkCleanUpObjectFactory that isn't cleaned up before vtkDebugLeaks.
It happens on Windows, but it might happen on other OS's.
One could replicate this by running a vtkMFC example in release mode with debug leaks on.