MemoryLeak: Webbrowser.Navigate

delphi package - automated exception handling
Post Reply
Han312
Posts: 54
Joined: Mon Mar 14, 2016 3:49 pm

MemoryLeak: Webbrowser.Navigate

Post by Han312 »

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: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: MemoryLeak: Webbrowser.Navigate

Post by madshi »

The leak report is missing.
Han312
Posts: 54
Joined: Mon Mar 14, 2016 3:49 pm

Re: MemoryLeak: Webbrowser.Navigate

Post by Han312 »

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: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: MemoryLeak: Webbrowser.Navigate

Post by madshi »

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

Re: MemoryLeak: Webbrowser.Navigate

Post by Han312 »

Thx - this helped

You should update http://help.madshi.net/madExceptUnit.htm
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: MemoryLeak: Webbrowser.Navigate

Post by madshi »

Yeah, I should.
Post Reply