Hi Joerg,

thanks for the hint I fixed it.

Andreas

Hi all!

There is a problem with MaterialDrawable::setMaterial.
Let's say we are doing something like this:

--cut----------------------------
GeometryPtr geo = Geometry::create();
MaterialDrawablePtr md = MaterialDrawablePtr::dcast(geo);
beginEditCP(md);
  md->setMaterial(myGlobalMaterial);
endEditCP(md);
--cut----------------------------

The problem with this code is that MaterialDrawable::setMaterial won't call addRefCP on myGlobalMaterial. But the destructor of Geometry calls subRefCP on the material. That produces a crash when deleting the scene graph which is nice to debug...

possible Solutions are:
(1) The setMaterial method of MaterialDrawable becomes virtual.
  or
(2) The setMaterial method of MaterialDrawable calls setRefdCP.


Regards,

Joerg.



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to