EditorToolBar: Fix a memory leakage. Issue #26569, patch from G. Colla.

git-svn-id: trunk@46026 -
This commit is contained in:
juha 2014-08-09 12:07:10 +00:00
parent 7e4fea476e
commit 4a1e95898b
2 changed files with 12 additions and 6 deletions

View File

@ -14,12 +14,17 @@
<UseAnsiStrings Value="False"/>
</SyntaxOptions>
</Parsing>
<Linking>
<Debugging>
<UseHeaptrc Value="True"/>
</Debugging>
</Linking>
</CompilerOptions>
<Description Value="Provides a configurable Toolbar in the source editor window, which can be positioned at any side. The toolbar comes with a predefined Jump button, and then Jump Forward and Jump Back buttons.
"/>
<License Value="GPL
"/>
<Version Minor="6" Release="2"/>
<Version Minor="6" Release="3"/>
<Files Count="4">
<Item1>
<Filename Value="jumpto_impl.pas"/>

View File

@ -157,15 +157,16 @@ begin
end;
procedure TEditorToolbarList.SourceWindowDestroyed(Sender: TObject);
var
i: integer;
aBar: TEditorToolbar;
var
i: integer;
aBar: TEditorToolbar;
begin
// Let's remove from our list the destroyed window
// Let's remove from our list the destroyed window and then destroy the ToolBar
for i:= 0 to FToolBarList.Count -1 do begin
aBar := TEditorToolbar(FToolBarList[i]);
if aBar.OwnerWindow = TSourceEditorWindowInterface(Sender) then begin
FToolBarList.Remove(aBar);
DelBar(aBar);
aBar.Free;
exit;
end;
end;