summaryrefslogtreecommitdiff
path: root/docview/components/richtext
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2011-08-29 11:47:05 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2011-08-29 11:47:05 +0200
commit37e4358e811eb1bd46daac90b6f4013a2b24161a (patch)
tree792e8d36df242dd7f814a82d8cbbc52cb08ddd9d /docview/components/richtext
parent11bc52823dca1cd5121be21d14c5eed85db6f8b6 (diff)
downloadfpGUI-37e4358e811eb1bd46daac90b6f4013a2b24161a.tar.xz
richview: removed DoAllocateWindowHandle() which caused a memory leak.
The above mentioned method called CreateWnd() twice, thus causing a memory leak. Now CreateWnd() is simply called once in the constructor.
Diffstat (limited to 'docview/components/richtext')
-rw-r--r--docview/components/richtext/RichTextView.pas14
1 files changed, 3 insertions, 11 deletions
diff --git a/docview/components/richtext/RichTextView.pas b/docview/components/richtext/RichTextView.pas
index 4c63f013..91bcab25 100644
--- a/docview/components/richtext/RichTextView.pas
+++ b/docview/components/richtext/RichTextView.pas
@@ -139,7 +139,6 @@ Type
FLastLinkOver: string;
FClickedLink: string;
- procedure DoAllocateWindowHandle(AParent: TfpgWindowBase); override;
Procedure CreateWnd;
procedure HandleResize(AWidth, AHeight: TfpgCoord); override;
procedure UpdateScrollBarCoords;
@@ -646,6 +645,8 @@ begin
FTopCharIndex := 0;
FVerticalPositionInitialised := false;
end;
+
+ CreateWnd;
end;
procedure TRichTextView.HandlePaint;
@@ -851,8 +852,7 @@ Begin
// while the canvas is still valid
// (it will be freed in TControl.DisposeWnd)
// in order to release logical fonts
- if FFontManager <> nil then
- FFontManager.Free;
+ FFontManager.Free;
if Assigned(FLayout) then
FreeAndNil(FLayout);
@@ -932,15 +932,8 @@ begin
FDefaultMenu.ShowAt(x, y);
end;
-procedure TRichTextView.DoAllocateWindowHandle(AParent: TfpgWindowBase);
-begin
- inherited DoAllocateWindowHandle(AParent);
- CreateWnd;
-end;
-
Procedure TRichTextView.CreateWnd;
begin
-ProfileEvent('DEBUG: TRichTextView.CreateWnd >>>>');
if InDesigner then
exit;
@@ -973,7 +966,6 @@ ProfileEvent('DEBUG: TRichTextView.CreateWnd >>>>');
if FLayoutRequired then
// we haven't yet done a layout
Layout;
-ProfileEvent('DEBUG: TRichTextView.CreateWnd <<<<');
end;
procedure TRichTextView.HandleResize(AWidth, AHeight: TfpgCoord);