Horde3D
http://www.horde3d.org/forums/

Geometry resource refcounts are not increased
http://www.horde3d.org/forums/viewtopic.php?f=3&t=562
Page 1 of 1

Author:  hayasaka [ 21.11.2008, 04:35 ]
Post subject:  Geometry resource refcounts are not increased

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;


Author:  marciano [ 22.11.2008, 15:34 ]
Post subject:  Re: Geometry resource refcounts are not increased

Right, that should be smart pointers. Thanks for catching that!

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/