On adding a Model node, geometry resource refcounts are not increased.
This means that following code couldn't run properly:
Code:
ResHandle res = Horde3D::addResource(ResourceTypes::SceneGraph, "man.scene.xml", 0);
Horde3DUtils::loadResourcesFromDisk("resources");
NodeHandle manNode = Horde3D::addNodes(Root, res);
Horde3D::removeResource(res);
Horde3D::releaseUnusedResources();
The call for releaseUnusedResources() removes geometry resource of the man as well,
and something weired (segfault, etc.) might be occured.
This patch fixes the problem:
Code:
--- /home/hayasaka/tmp/horde3d/svn-vendor/Horde3D/trunk/Horde3D/Source/Horde3DEngine/egModel.h 2008-11-10 02:26:29.000000000 +0900
+++ Horde3D/Source/Horde3DEngine/egModel.h 2008-11-21 10:18:49.000000000 +0900
@@ -98,8 +98,8 @@
{
protected:
- GeometryResource *_geometryRes;
- GeometryResource *_baseGeoRes;
+ PGeometryResource _geometryRes;
+ PGeometryResource _baseGeoRes;
std::vector< Vec4f > _skinMatRows;
bool _softwareSkinning;