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:
@@ -15,8 +15,8 @@ namespace osg {
|
||||
* the standard pure virtual clone, isSameKindAs and className methods
|
||||
* which are required for all Object subclasses.*/
|
||||
#define META_Object(T) \
|
||||
virtual osg::Object* cloneType() const { return new T (); } \
|
||||
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new T (*this,copyop); } \
|
||||
virtual osg::Object* cloneType() const { return osgNew T (); } \
|
||||
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return osgNew T (*this,copyop); } \
|
||||
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const T *>(obj)!=NULL; } \
|
||||
virtual const char* className() const { return #T; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user