Futher updates to MemoryManager, fixed memory leak in osgconv.
This commit is contained in:
@@ -10,16 +10,16 @@ C++ = g++
|
||||
YFLAGS = -d
|
||||
LCINCS += -I/usr/X11R6/include
|
||||
LC++INCS += ${LCINCS}
|
||||
CFLAGS = -O2 -W -Wall $(LCINCS)
|
||||
'CFLAGS = -g -DOSG_USE_MEMORY_MANAGER -W -Wall $(LCINCS)
|
||||
#CFLAGS = -O2 -W -Wall $(LCINCS)
|
||||
CFLAGS = -g -DOSG_USE_MEMORY_MANAGER -W -Wall $(LCINCS)
|
||||
C++FLAGS = ${CFLAGS}
|
||||
CPPFLAGS = ${CFLAGS}
|
||||
|
||||
SO_EXT = so
|
||||
DL_EXT = so
|
||||
|
||||
LDFLAGS = -O2 -W -Wall -L/usr/X11R6/lib
|
||||
#LDFLAGS = -g -W -Wall -L/usr/X11R6/lib
|
||||
#LDFLAGS = -O2 -W -Wall -L/usr/X11R6/lib
|
||||
LDFLAGS = -g -W -Wall -L/usr/X11R6/lib
|
||||
|
||||
LINKERARGS = -Xlinker
|
||||
DYNAMICLIBRARYLIB = -ldl
|
||||
|
||||
@@ -80,9 +80,12 @@ class OSGUTIL_EXPORT SceneView : public osg::Referenced
|
||||
/** Set the DisplaySettings. */
|
||||
inline void setDisplaySettings(osg::DisplaySettings* vs) { _displaySettings = vs; }
|
||||
|
||||
/** Get the DisplaySettings */
|
||||
/** Get the const DisplaySettings */
|
||||
inline const osg::DisplaySettings* getDisplaySettings() const { return _displaySettings.get(); }
|
||||
|
||||
/** Get the DisplaySettings */
|
||||
inline osg::DisplaySettings* getDisplaySettings() { return _displaySettings.get(); }
|
||||
|
||||
|
||||
/** Set the background color used in glClearColor().
|
||||
Defaults to an off blue color.*/
|
||||
|
||||
@@ -206,12 +206,12 @@ int main( int argc, char **argv )
|
||||
fileNames.pop_back();
|
||||
}
|
||||
|
||||
osg::Node* root = osgDB::readNodeFiles(fileNames);
|
||||
osg::ref_ptr<osg::Node> root = osgDB::readNodeFiles(fileNames);
|
||||
|
||||
if( do_convert )
|
||||
root = oc.convert( root );
|
||||
root = oc.convert( root.get() );
|
||||
|
||||
if (root)
|
||||
if (root.valid())
|
||||
{
|
||||
osgDB::writeNodeFile(*root,fileNameOut);
|
||||
osg::notify(osg::NOTICE)<<"Data written to '"<<fileNameOut<<"'."<< std::endl;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -477,7 +477,12 @@ Image* Registry::readImage(Input& fr)
|
||||
|
||||
}
|
||||
|
||||
return dynamic_cast<Image*>(readObject(_imageWrapperMap,fr));
|
||||
osg::Object* obj = readObject(_imageWrapperMap,fr);
|
||||
osg::Image* image = dynamic_cast<Image*>(obj);
|
||||
if (image) return image;
|
||||
else if (obj) obj->unref();
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -498,7 +503,12 @@ Drawable* Registry::readDrawable(Input& fr)
|
||||
|
||||
}
|
||||
|
||||
return dynamic_cast<Drawable*>(readObject(_drawableWrapperMap,fr));
|
||||
osg::Object* obj = readObject(_drawableWrapperMap,fr);
|
||||
osg::Drawable* drawable = dynamic_cast<Drawable*>(obj);
|
||||
if (drawable) return drawable;
|
||||
else if (obj) obj->unref();
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -539,7 +549,12 @@ Node* Registry::readNode(Input& fr)
|
||||
|
||||
}
|
||||
|
||||
return dynamic_cast<Node*>(readObject(_nodeWrapperMap,fr));
|
||||
osg::Object* obj = readObject(_nodeWrapperMap,fr);
|
||||
osg::Node* node = dynamic_cast<Node*>(obj);
|
||||
if (node) return node;
|
||||
else if (obj) obj->unref();
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user