From: <ah...@us...> - 2013-05-07 06:23:39
|
Revision: 13507 http://jvcl.svn.sourceforge.net/jvcl/?rev=13507&view=rev Author: ahuser Date: 2013-05-07 06:23:30 +0000 (Tue, 07 May 2013) Log Message: ----------- Fixed Undo-Objects memory leak Modified Paths: -------------- trunk/jvcl/run/JvEditorCommon.pas Modified: trunk/jvcl/run/JvEditorCommon.pas =================================================================== --- trunk/jvcl/run/JvEditorCommon.pas 2013-04-30 05:30:59 UTC (rev 13506) +++ trunk/jvcl/run/JvEditorCommon.pas 2013-05-07 06:23:30 UTC (rev 13507) @@ -361,6 +361,7 @@ FJvEditor: TJvCustomEditorBase; FPtr: Integer; InUndo: Boolean; + FDiscardList: TObjectList; function LastUndo: TJvUndo; function IsNewGroup(AUndo: TJvUndo): Boolean; function CanRedo: Boolean; @@ -1436,7 +1437,12 @@ procedure TJvUndoBuffer.Add(AUndo: TJvUndo); begin if InUndo then + begin + if FDiscardList = nil then + FDiscardList := TObjectList.Create; + FDiscardList.Add(AUndo); Exit; + end; ClearRedo; inherited Add(AUndo); FPtr := Count - 1; @@ -1527,6 +1533,7 @@ FJvEditor.StatusChanged; end; finally + FreeAndNil(FDiscardList); InUndo := False; end; end; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |