Dirk
I modified the code to look like this:
//----------
[...]
OSG::RefPtr<OSG::TextureChunkPtr> pTexture(createTexture(false));
[...]
OSG::beginEditCP(m_pViewportPass2);
m_pViewportPass2->getTextures().push_back(pTexture);
OSG::endEditCP(m_pViewportPass2);
m_pViewportPass2->render(pAction);
OSG::beginEditCP(m_pViewportPass2);
for (int i = 0; i < m_pViewportPass2->getTextures().size(); ++i)
{
OSG::subRefCP(m_pViewportPass2->getTextures(i));
}
m_pViewportPass2->getTextures().clear();
OSG::endEditCP(m_pViewportPass2);
[...]
//----------
I tried it with both subRefCP and subRef as well as with and without
the clear. Each time, my app crashed. Probably because the subRef
decreased the ref-count from 1 to something which looked a lot like an
"unsigned -1".
I'll try to write that small sample app over the weekend.
Best regards,
Marco
>>> Dirk Reiners <[EMAIL PROTECTED]> 18.09.2008 14:13 >>>
Hi Marco,
Marco Spoerl wrote:
> Thanks for your tips. Unfortunately, it doesn't seem to be a
ref-count
> problem with the texture array. Both the texture and the image passed
to
> "render" return with the same ref-count they originally had: 1.
Hm, that's not quite clear to me. Did you try manually subRef-ing the
pointers there instead of calling clear()?
> But I
> have to try some of the other possible leak sources mentioned in the
> wiki. And I could try to write a small app to reproduce the
behaviour,
> if this is of any help for the OpenSG developers?
>
That's always the best way to get a quick response. Reproducing the
problem is most of the time 80% of the effort, so if we can save
ourselves that part we're much more likely to give it a shot.
Yours
Dirk
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the
world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users