Horde3D

Next-Generation Graphics Engine
It is currently 25.11.2024, 07:12

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 21.11.2008, 04:35 
Offline

Joined: 21.11.2008, 04:06
Posts: 6
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;



Top
 Profile  
Reply with quote  
PostPosted: 22.11.2008, 15:34 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
Right, that should be smart pointers. Thanks for catching that!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group