From: <ob...@us...> - 2008-10-10 07:29:03
|
Revision: 11957 http://jvcl.svn.sourceforge.net/jvcl/?rev=11957&view=rev Author: obones Date: 2008-10-10 07:28:59 +0000 (Fri, 10 Oct 2008) Log Message: ----------- Mantis 4518: ChangeLinks must be freed after the inherited destroy has run. Modified Paths: -------------- trunk/jvcl/run/JvMenus.pas Modified: trunk/jvcl/run/JvMenus.pas =================================================================== --- trunk/jvcl/run/JvMenus.pas 2008-10-09 20:34:23 UTC (rev 11956) +++ trunk/jvcl/run/JvMenus.pas 2008-10-10 07:28:59 UTC (rev 11957) @@ -963,11 +963,18 @@ FHotImageChangeLink.Free; FDisabledImageChangeLink.Free; FStyleItemPainter.Free; - FChangeLinks.Free; FImageMargin.Free; FImageSize.Free; UnregisterWndProcHook(FindForm, NewWndProc, hoAfterMsg); inherited Destroy; + + // Mantis 4518: When removing the menu, the inherited Destroy will destroy + // every item in turn. This will call MenuChanged which uses FChangeLinks, + // hence the need to free it after the inherited destroy has run. + // Note that testing csDestroying in ComponentState is not desirable as + // the menu could be destroyed at design time and still should notify the + // components that registered to be notified. + FChangeLinks.Free; end; procedure TJvMainMenu.Loaded; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |