Re: [Plib-users] Bug report
Brought to you by:
sjbaker
From: Steve B. <sjb...@ai...> - 2001-04-02 23:16:14
|
Fredrik Sandström wrote: > > On Sun, 1 Apr 2001, Per Liedman wrote: > > > I don't think it should be deleted. It's just a pointer to a node, and that > > node is a part of the model that is loaded, and thus should not be deleted. > > But I could be missing some fine details of my own code. Feel free to comment > > further if you have any examples of when current_branch causes leaks. I've just read the code - and I agree - 'current_branch' is just a temporary variable used to hold a pointer between it being created and it's child objects finally being bolted into the tree. I don't see what it's holding that won't be deallocated when the tree is ultimately 'delete'd. > After doing... > > ssgEntity *loadThis = ssgLoad(tmp); > delete loadThis; > loadThis = NULL; > > ...the debugger reports that memory allocated to current_branch hasn't > been deallocated, so the leak is somewhere in the loader at least. I don't know what the debugger is thinking here...I don't see how something can be passed into current_branch without being connected into the tree - and 'ref' counting should take care of the cleanup after that. -- Steve Baker HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://web2.airmail.net/sjbaker1 Projects : http://plib.sourceforge.net http://tuxaqfh.sourceforge.net http://tuxkart.sourceforge.net http://prettypoly.sourceforge.net http://freeglut.sourceforge.net |