Added support for osg::MemoryManager which is based upon Paul Nettle's
memory manager published at flipcode.com. This can be turned on with the OSG_USE_MEMORY_MANGER option which then uses custom global new and delete operators as well as provide osgNew and osgDelete macro's which add ability to log line and file from which calls are made. Updated osg,osgUtil,osgDB,osgText and osgPlugins/osg to use osgNew/osgDelete, and fixed memory leaks highlighted by the new memory manager.
This commit is contained in:
@@ -41,11 +41,11 @@ DynamicLibrary* DynamicLibrary::loadLibrary(const std::string& libraryName)
|
||||
|
||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
||||
HANDLE handle = LoadLibrary( fullLibraryName );
|
||||
if (handle) return new DynamicLibrary(libraryName,handle);
|
||||
if (handle) return osgNew DynamicLibrary(libraryName,handle);
|
||||
notify(WARN) << "DynamicLibrary::failed loading "<<fullLibraryName<<std::endl;
|
||||
#elif !defined(macintosh)
|
||||
HANDLE handle = dlopen( fullLibraryName, RTLD_LAZY );
|
||||
if (handle) return new DynamicLibrary(libraryName,handle);
|
||||
if (handle) return osgNew DynamicLibrary(libraryName,handle);
|
||||
notify(WARN) << "DynamicLibrary::failed loading "<<fullLibraryName<<std::endl;
|
||||
notify(WARN) << "DynamicLibrary::error "<<dlerror()<<std::endl;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user