Commit a0586d7f authored by loring's avatar loring

libsim: fix small leaks of various static objects



git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@23270 18c085ea-50e0-402c-830e-de6fd14e8384
parent 5d15348b
......@@ -133,6 +133,7 @@ avtFileDescriptorManager::DeleteInstance(void)
if (instance)
{
delete instance;
instance = 0;
}
}
......
......@@ -112,6 +112,7 @@ ${VISIT_SOURCE_DIR}/engine/main
${VISIT_SOURCE_DIR}/engine/proxy
${VISIT_SOURCE_DIR}/engine/rpc
${VISIT_SOURCE_DIR}/sim/V2/lib
${VISIT_SOURCE_DIR}/visit_vtk/lightweight/
)
LINK_DIRECTORIES(
......
......@@ -63,6 +63,10 @@
#include <map>
#include <vector>
#include <vtkVisItUtility.h>
#include <avtFileDescriptorManager.h>
extern void DataCallbacksCleanup(void);
//
......@@ -242,8 +246,13 @@ void simv2_disconnect()
TRY
{
Engine::DisconnectSimulation();
if (visitTimer)
TimingsManager::Finalize();
vtkVisItUtility::CleanupStaticVTKObjects();
avtFileDescriptorManager::DeleteInstance();
DataCallbacksCleanup();
}
CATCHALL
......
......@@ -1287,9 +1287,18 @@ void vtkVisItUtility::RegisterStaticVTKObject(vtkObject* obj)
// Creation: September 27, 2011
//
// Modifications:
//
// Burlen Loring, Fri May 2 14:27:13 PDT 2014
// Set pointers to NULL after deletion to allow for libsim
// reconnections.
//
// ****************************************************************************
namespace {
template <class T> static void DeleteVTK(T* t) { t->Delete(); }
template <class T> static void DeleteVTK(T* t)
{
t->Delete();
t = NULL;
}
#ifndef NDEBUG
template <class T> static void PrintVTK(T* t) {
debug5 << " obj: " << t->GetClassName() << "\n";
......
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