On Friday 13 June 2003 08:54, Richard Bown wrote:
> On Friday 13 June 2003 6:03 am, Levi Burton wrote:
> > SegmentMover* mover =
> > dynamic_cast<SegmentResizer*>(getToolBox()->getTool(SegmentMover::Too
> >lName));
> >
> > It would actually segfault in the call to dynamic_cast. A mystery to
> > me, but not deleting the tool and just assigning the value 0 to it
> > seems to have fixed the problem, although there could be
> > ramifications i'm not aware of.
>
> Uhm, a memory leak. Yes.
No. Tools are singletons, they can only be obtained from the ToolBox, which
creates them on demand but keeps them in a hash table indexed by the
toolname. So you can getTool(ToolName) all you want, it will create the tool
just once. Levi was right, you should never delete a tool.
--
Guillaume
http://www.telegraph-road.org
-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
Rosegarden-devel mailing list
[EMAIL PROTECTED] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel