Summary: Leaking GDI Objects (Security Icon)
Creator:ra Date:2004-10-21 09:19:23
Project:K-Meleon Owner:Ulf
Status:Closed Severity:Critical
Version:Unknow Target Version:Unknow

K-Meleon is leaking GDI objects (the main browser, no gecko fault). Just disable all plugins and have a look at the task manager with GDI objects shown, open 30 new windows and close them again. Normally the usage of GDI Objects should go down again to around the value it had when only one window was open, but that doesn't happen with every K-Meleon version greater 0.4 (which was the best K-M version ever in that respect)!

I have been digging through the code to find out what's causing it the last few days and I finally found a way to at least stop the leak. I don't know any C, so fixing the underlying problem probably has to be done by someone else.

Commenting out the following in BrowserFrm.cpp (line 609ff in the "latest", five months old CVS code as of today) within "void CBrowserFrame::UpdateSecurityStatus(PRInt32 aState)" stops the leaking:

CStatusBarCtrl& sb = m_wndStatusBar.GetStatusBarCtrl();
sb.SetIcon(2, //2 is the pane index of the status bar where the lock icon will be shown
       (HICON)::LoadImage(AfxGetResourceHandle(),
       MAKEINTRESOURCE(iResID), IMAGE_ICON, 16,16,LR_LOADMAP3DCOLORS));

From what I know these lines of code are correct, so I guess the problem lies in the way when/if/why or how often this code is called. Or there is a freeing of resources or s.th. like that missing.

Removing/commenting out this code removes the security icon in the lower right corner (that displays either an insecure, a secure or a broken lock icon), but apart from that everything works just fine. *g*

Comments
amutch  2004-11-26 21:21:41
Beta 3 has fixed the leak. However the security icon fails to repaint completely. How should we handle that? In this bug or separately?
[Changed Status from "Unconfirmed" to "Open"]
amutch  2004-11-26 21:23:21

[Changed Severity from "Normal" to "Very Important"]
[Changed Owner from ".Nobody" to "Ulf"]
ra  2004-12-14 09:02:41
The repaint issue is fixed in further builds. I'd notice you if it should mystically re-appear in the next beta(s). ;-)
rmn  2005-01-25 01:18:32

[Changed Status from "Open" to "Closed"]

SourceForge Logo