Hi,
thanks for the help... I've finally found the problem.. I've posted a few
messages about some children node removal problem.. the issue in my last
mail about init / exit was thought as having something to do with the node
removal problem.. but it hasn't .. the problem was simple: The
SimpleSceneManager class has a function named 'setHighlight' that, as the
name says, sets a node as highlighted and draws a visible bounding box
around it. When I removed the node from the scene its reference seemed to be
set to count zero and it got deleted (?), but the simplescenemanager kept a
reference to it ( invalid, any how ).... So, when the scene was being
redrawed, the scenemanager accessed this node and the program crashes...
so, the solution was to simple set the hightlighted node to null before
removing it from the scene.... scenemanger->setHighLight( OSG::NullFC )...
But my question is: why does the scenemanager reference (NodePtr) got
invalid .. if the scenemanager had a reference to the node, the node
shouldn't be deleted...(?) so, it seems that the scenemanager setHighLight
isn't increasing the reference count of the given NodePtr passed as
parameter.... I'm not sure if it should be increased or not (I'm mean, if it
is the right manner to avoid crashing)... if the reference got increased,
the node whould stay as a child of the scenemanager class. In the other
hand, if its reference is not increased, it goes against the reference
counting principle (?)... to count all references and never delete it before
it get to zero and automatically deletes it when it does....
Thanks
[]'s
2007/10/18, Carsten Neumann <[EMAIL PROTECTED]>:
>
> Hello Pablo,
>
> Pablo Carneiro Elias wrote:
> > Hi, we're experiencing random access violations in our program under
> > windows, and it seems to have something to do with OpenSG. We did this
> > simple test:
> >
> > int main( int argc, char *argv[] )
> > {
> > bool init1 = OSG::osgInit( argc, argv );
> > bool exit1 = OSG::osgExit();
> >
> > bool init2 = OSG::osgInit( argc, argv );
> > bool exit2 = OSG::osgExit();
> >
> > return 0;
> > }
>
> sorry, but this tests does not allow many conclusions, because it is
> fully expected to fail. OpenSG makes use a lot of static initialization
> and (in order to reduce the amount of memory reported as being leaked)
> tries to clean that up during osgExit. So once you call osgExit a lot of
> the internal objects are lost and they can not be reocovered.
>
> > This program crashes at the second osgExit() call. But if we comment
> this
> > line, it crashes at the "return 0". If we comment the second osgInit(),
> then
> > the program "works".
>
> yes, the only surprise here is that it even makes it through osgInit ;)
>
> > But in our real application we're experiencing a similar crash even
> though
> > we only call osgInit() once (and don't even call osgExit()). If we
> remove
> > nodes from the graph, the program will crash at random locations. I've
> > already checked and both our program and OpenSG are use the same runtime
> > libraries.
> >
> > Looks like memory corruption. Any clues?!
>
> that is a possibility, my general bet would be that you have objects in
> your scene that have actually been deleted already.
> I'm really sorry but I don't know how to help you track this down other
> than that you might want to run a traversal over the scene that prints
> the reference count of the objects and look for those that have a zero
> there.
> The reference count can be obtained by calling a member function of the
> pointer, i.e.
>
> NodePtr p = Node::create();
> p.getRefCount() // note . instead of ->
>
> Hope it helps,
> Carsten
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Opensg-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensg-users
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users