Try to get rid of memory leak in IOManager

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@830 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
Jan Möbius
2013-06-05 07:33:16 +00:00
parent adf464de77
commit ee648b6da1
2 changed files with 16 additions and 13 deletions

View File

@@ -101,13 +101,19 @@ class OPENMESHDLLEXPORT _IOManager_
{
private:
/// Constructor has nothing todo for the Manager
_IOManager_() {}
/// Destructor has nothing todo for the Manager
~_IOManager_() {};
/** Declare the singleton getter function as friend to access the private constructor
and destructor
*/
friend OPENMESHDLLEXPORT _IOManager_& IOManager();
public:
/**
Read a mesh from file _filename. The target data structure is specified
by the given BaseImporter. The \c read method consecutively queries all
@@ -247,12 +253,10 @@ private:
//=============================================================================
extern _IOManager_* __IOManager_instance;
//_IOManager_* __IOManager_instance; Causes memory leak, as destructor is never called
OPENMESHDLLEXPORT _IOManager_& IOManager();
//=============================================================================
} // namespace IO
} // namespace OpenMesh