Memory leak in TDBRichView
Posted: Mon Mar 28, 2016 11:49 am
Hello,
I have the following code:
The application compiles and runs regularly but MadExcept http://madshi.net/madExceptDescription.htm detects a problem when I close the application. The following is the report:
because if I comment it out I have no warnings but in this case some operations cannot be performed by TDBRichViewEdit. How can I solve the issue ?
Many thanks
Alberto
I have the following code:
Code: Select all
unit Unit1;
interface
uses
Winapi.Windows,
Winapi.Messages,
System.SysUtils,
System.Variants,
System.Classes,
Vcl.Graphics,
rvstyle,
Vcl.Controls,
Vcl.Forms,
Vcl.Dialogs,
RVScroll,
RichView,
RVEdit,
DBRV;
type
TForm1 = class(TForm)
procedure FormActivate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
FForm: TForm;
FRVStyle: TRVStyle;
FDBRichViewEdit: TDBRichView;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormActivate(Sender: TObject);
begin
FRVStyle := TRVStyle.Create(nil);
FDBRichViewEdit := TDBRichView.Create(nil);
FDBRichViewEdit.Parent := Self;
FDBRichViewEdit.Style := FRVStyle;
FDBRichViewEdit.Visible := True;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
FRVStyle.Free;
FDBRichViewEdit.Free;
end;
It seems the issue is generated by the lineend.allocation number: 1932
program up time: 1.22 s
type: OpenThemeData
address: $b0002
access rights: ./.
main thread ($1fa8):
671d409a madExcept32.dll madExceptDbg 5504 OpenThemeDataCallback
006eb314 Project2.exe RVScroll 1289 TRVScroller.CreateThemeHandle
006e9acd Project2.exe RVScroll 499 TRVScroller.CreateWnd
00514fbe Project2.exe Vcl.Controls TWinControl.CreateHandle
00515288 Project2.exe Vcl.Controls TWinControl.UpdateShowing
005152b6 Project2.exe Vcl.Controls TWinControl.UpdateShowing
00515430 Project2.exe Vcl.Controls TWinControl.UpdateControlState
00514682 Project2.exe Vcl.Controls TWinControl.InsertControl
0050fba8 Project2.exe Vcl.Controls TControl.SetParent
0051ae9d Project2.exe Vcl.Controls TWinControl.SetParent
0074ff98 Project2.exe Unit1 45 TForm1.FormActivate
00591c27 Project2.exe Vcl.Forms TCustomForm.Activate
00592ce8 Project2.exe Vcl.Forms TCustomForm.CMActivate
005115c5 Project2.exe Vcl.Controls TControl.WndProc
00515f23 Project2.exe Vcl.Controls TWinControl.WndProc
0058f24d Project2.exe Vcl.Forms TCustomForm.WndProc
00515578 Project2.exe Vcl.Controls TWinControl.MainWndProc
00489538 Project2.exe System.Classes StdWndProc
7650558d USER32.dll SendMessageW
0058c12c Project2.exe Vcl.Forms SendFocusMessage
00515b27 Project2.exe Vcl.Controls TWinControl.WndProc
0058f24d Project2.exe Vcl.Forms TCustomForm.WndProc
00515578 Project2.exe Vcl.Controls TWinControl.MainWndProc
00489538 Project2.exe System.Classes StdWndProc
7794700b ntdll.dll KiUserCallbackDispatcher
00515f23 Project2.exe Vcl.Controls TWinControl.WndProc
0058f24d Project2.exe Vcl.Forms TCustomForm.WndProc
00515578 Project2.exe Vcl.Controls TWinControl.MainWndProc
00489538 Project2.exe System.Classes StdWndProc
7794700b ntdll.dll KiUserCallbackDispatcher
005115c5 Project2.exe Vcl.Controls TControl.WndProc
00515f23 Project2.exe Vcl.Controls TWinControl.WndProc
0058f24d Project2.exe Vcl.Forms TCustomForm.WndProc
00511200 Project2.exe Vcl.Controls TControl.Perform
00515321 Project2.exe Vcl.Controls TWinControl.UpdateShowing
00515430 Project2.exe Vcl.Controls TWinControl.UpdateControlState
0051803e Project2.exe Vcl.Controls TWinControl.CMVisibleChanged
00515f23 Project2.exe Vcl.Controls TWinControl.WndProc
0058f24d Project2.exe Vcl.Forms TCustomForm.WndProc
00511200 Project2.exe Vcl.Controls TControl.Perform
0050fbde Project2.exe Vcl.Controls TControl.SetVisible
00759a49 Project2.exe Project2 18 initialization
7645ef1a kernel32.dll BaseThreadInitThunk
Code: Select all
FDBRichViewEdit.Parent := Self;
Many thanks
Alberto