delphi package - automated exception handling
Han312
Posts: 54 Joined: Mon Mar 14, 2016 3:49 pm
Post
by Han312 » Thu Apr 14, 2016 2:50 pm
I am struggling for a while to find out why madExcept is reporting a memoryleak and what I can do against it.
I added tWebBrowser on a simple form and starting and closing the form is causing a memory leak report:
Code: Select all
type
TForm1 = class(TForm)
WebBrowser: TWebBrowser;
procedure FormCreate(Sender: TObject);
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
WebBrowser.Navigate('about:blank' );
end;
madshi
Site Admin
Posts: 10765 Joined: Sun Mar 21, 2004 5:25 pm
Post
by madshi » Thu Apr 14, 2016 3:04 pm
The leak report is missing.
Han312
Posts: 54 Joined: Mon Mar 14, 2016 3:49 pm
Post
by Han312 » Thu Apr 14, 2016 3:29 pm
Code: Select all
allocation number: 1992
program up time: 905 ms
type: Thread Handle
handle: $97c
access rights: $1fffff
threadId: $1184
processId: $1810
process exe: C:\Users\123\Documents\Embarcadero\Studio\Projekte\Win32\Debug\Test02.exe
main thread ($1bb8):
671d1dca madExcept32.dll madExceptDbg 3805 CreateThreadCallback
004a4f97 Test02.exe madExcept HookedCreateThread
7667139c msvcrt.dll _beginthreadex
761596d0 USER32.dll SendMessageW
allocation number: 1980
program up time: 844 ms
type: Thread Handle
handle: $99c
access rights: $1fffff
threadId: $21d0
processId: $1810
process exe: C:\Users\123\Documents\Embarcadero\Studio\Projekte\Win32\Debug\Test02.exe
main thread ($1bb8):
671d1dca madExcept32.dll madExceptDbg 3805 CreateThreadCallback
004a4f97 Test02.exe madExcept HookedCreateThread
7667139c msvcrt.dll _beginthreadex
761596d0 USER32.dll SendMessageW
00644ca3 Test02.exe SHDocVw 2837 TWebBrowser.Navigate
006459da Test02.exe Test01 24 TForm1.FormCreate
006259d1 Test02.exe Vcl.Forms 3746 TCustomForm.DoCreate
006255d5 Test02.exe Vcl.Forms 3629 TCustomForm.AfterConstruction
00625587 Test02.exe Vcl.Forms 3619 TCustomForm.Create
0063036a Test02.exe Vcl.Forms 10471 TApplication.CreateForm
0064e869 Test02.exe Test02 17 initialization
750a3388 kernel32.dll BaseThreadInitThunk
madshi
Site Admin
Posts: 10765 Joined: Sun Mar 21, 2004 5:25 pm
Post
by madshi » Thu Apr 14, 2016 3:34 pm
Probably a real leak.
You could try to hide it by using this new API introduced in the latest madExcept build:
Code: Select all
// This API allows you to hide leaks based on their callstack.
// e.g. 'MakeObjectInstance|TApplication.Create'
function HideLeak (const callstack: UnicodeString) : boolean; overload;
Han312
Posts: 54 Joined: Mon Mar 14, 2016 3:49 pm
Post
by Han312 » Fri Apr 15, 2016 7:11 am
madshi
Site Admin
Posts: 10765 Joined: Sun Mar 21, 2004 5:25 pm
Post
by madshi » Fri Apr 15, 2016 7:25 am
Yeah, I should.