Official eMule-Board: Gdi Leak - Official eMule-Board

Jump to content


Page 1 of 1

Gdi Leak Prefrences-Directories on close

#1 User is offline   Rapid_Mule 

  • "routing problems on the neural net"
  • PipPipPipPipPip
  • Group: Members
  • Posts: 256
  • Joined: 03-May 04

Posted 17 December 2007 - 01:39 AM

Well I hope i get this one right and avoid the wrath of our well "composed" Stulle. :angelnot:
I get GDI leaks after closing Prefrences-Directories the counters just keep going up is it a leak?

PS: just finished monitoring the official 0.48a client and I get the same leaks (It's not me that's leaking, so don't get any fancy ideas you weirdos). :P
0

#2 User is offline   Enig123 

  • Magnificent Member
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 375
  • Joined: 22-November 04

Posted 17 December 2007 - 02:18 AM

That would better to report also in the Bug-Report section of this forum so the official team can notice it more easily.
0

#3 User is offline   Rapid_Mule 

  • "routing problems on the neural net"
  • PipPipPipPipPip
  • Group: Members
  • Posts: 256
  • Joined: 03-May 04

Posted 17 December 2007 - 05:02 AM

View PostEnig123, on Dec 17 2007, 04:18 AM, said:

That would better to report also in the Bug-Report section of this forum so the official team can notice it more easily.

If someone else confirms the issue then Leuk_he can move the topic there.

Regards.
0

#4 User is offline   Enig123 

  • Magnificent Member
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 375
  • Joined: 22-November 04

Posted 17 December 2007 - 05:38 AM

View PostRapid_Mule, on Dec 17 2007, 05:02 AM, said:

If someone else confirms the issue then Leuk_he can move the topic there.


I can confirm this issue with official eMule 0.48a. The GDI handler increased by 5 each time I access the Prefrences-Directories.
0

#5 User is offline   Ergol 

  • Premium Member
  • PipPipPipPipPip
  • Group: Members
  • Posts: 314
  • Joined: 07-March 03

Posted 17 December 2007 - 06:57 AM

4 GDI not released each time after entering and leaving (by OK/Cancel/switch to other "Options") Options->Directories here.

eMule 0.48a; Windows XP SP2.

Hope it helps.
0

#6 User is offline   Stulle 

  • [Enter Mod] Dev
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5221
  • Joined: 07-April 04

Posted 17 December 2007 - 07:28 AM

View PostRapid_Mule, on Dec 17 2007, 02:39 AM, said:

Well I hope i get this one right and avoid the wrath of our well "composed" Stulle. :angelnot:
I get GDI leaks after closing Prefrences-Directories the counters just keep going up is it a leak?

PS: just finished monitoring the official 0.48a client and I get the same leaks (It's not me that's leaking, so don't get any fancy ideas you weirdos). :P

that's a smart post, don't fear my wrath for i will only be annoyed by stupid posts. :P

anyway, i have little idea what could happen. might be worth looking into it, though. thanks for the report.
I am an emule-web.de member and fan! Hate me or people will get suspicious about you! Ever wondered if it's all worth the trouble?

Posted Image

No, there will not be a new version of my mods. No, I do not want your PM. No, I am certain, use the board and quit sending PMs. No, I am not kidding, there will not be a new version of my mods just because of YOU asking for it!
0

#7 User is offline   leuk_he 

  • MorphXT team.
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5974
  • Joined: 11-August 04

Posted 20 December 2007 - 08:14 PM

Moving from morph to official because rapid mule concludes this is in official as well.


PS, @rapidmule
If you want tot debug this you can remove code until the gdi leak no longer happens.
Download the MorphXT emule mod here: eMule Morph mod

Trouble connecting to a server? Use kad and /or refresh your server list
Strange search results? Check for fake servers! Or download morph, enable obfuscated server required, and far less fake server seen.

Looking for morphXT translators. If you want to translate the morph strings please come here (you only need to be able to write, no coding required. ) Covered now: cn,pt(br),it,es_t,fr.,pl Update needed:de,nl
-Morph FAQ [English wiki]--Het grote emule topic deel 13 [Nederlands]
if you want to send a message i will tell you to open op a topic in the forum. Other forum lurkers might be helped as well.
0

#8 User is offline   Rapid_Mule 

  • "routing problems on the neural net"
  • PipPipPipPipPip
  • Group: Members
  • Posts: 256
  • Joined: 03-May 04

Posted 25 December 2007 - 09:31 AM

View Postleuk_he, on Dec 20 2007, 10:14 PM, said:

Moving from morph to official because rapid mule concludes this is in official as well.


PS, @rapidmule
If you want tot debug this you can remove code until the gdi leak no longer happens.

Well since I have nothing to do on xmas except for wasting my pathetic life on MMORPGs, I've spent sometime trying to debug this issue and here we go:

Quote

TVS_CHECKBOXES
...
Once a tree-view control is created with this style, the style cannot be removed. Instead, you must destroy the control and create a new one in its place. Destroying the tree-view control does not destroy the check box state image list. You must destroy it explicitly. Get the handle to the state image list by sending the tree-view control a TVM_GETIMAGELIST message. Then destroy the image list with ImageList_Destroy.
...


Now since I've got no clue what that means (Really the only time I code something then it's in Perl and only small scripts). Apparently I need to add something like the following:
	// => Start
	HIMAGELIST handle = TreeView_GetImageList(m_wndDirectories.GetHandle(), TVSIL_STATE);
	if (handle != NULL)
		ImageList_Destroy(handle);
	// <= End

I've no Idea where to insert the code, tried CPreferencesDlg::OnDestroy() but then I didn't figure out how to get the m_ShareSelector handle.
HWND CPPgDirectories::GetHandle()
{
	return m_ShareSelector.GetSafeHwnd();
}

Seems to work fine but can't wait to learn more. :unsure:
0

#9 User is offline   Enig123 

  • Magnificent Member
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 375
  • Joined: 22-November 04

Posted 04 January 2008 - 06:53 AM

Well, just tried Rapid_Mule's code by putting GetHandle() into PPgDirectories.h, and, or course the first part in CPreferencesDlg::OnDestroy(). It worked as expected. The Gdi Leak gone.
0

#10 User is offline   leuk_he 

  • MorphXT team.
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5974
  • Joined: 11-August 04

Posted 08 January 2008 - 09:28 PM

please double check if this fixes it:

http://emulemorph.cv...amp;sortby=date :flowers:
Download the MorphXT emule mod here: eMule Morph mod

Trouble connecting to a server? Use kad and /or refresh your server list
Strange search results? Check for fake servers! Or download morph, enable obfuscated server required, and far less fake server seen.

Looking for morphXT translators. If you want to translate the morph strings please come here (you only need to be able to write, no coding required. ) Covered now: cn,pt(br),it,es_t,fr.,pl Update needed:de,nl
-Morph FAQ [English wiki]--Het grote emule topic deel 13 [Nederlands]
if you want to send a message i will tell you to open op a topic in the forum. Other forum lurkers might be helped as well.
0

#11 User is offline   Rapid_Mule 

  • "routing problems on the neural net"
  • PipPipPipPipPip
  • Group: Members
  • Posts: 256
  • Joined: 03-May 04

Posted 09 January 2008 - 10:26 AM

View Postleuk_he, on Jan 8 2008, 11:28 PM, said:

please double check if this fixes it:

http://emulemorph.cv...amp;sortby=date :flowers:

Had to add a declaration for OnDestroy() to be able to compile it.
PPgDirectories.h
...
	DECLARE_MESSAGE_MAP()
...
	afx_msg void OnBnClickedSeltempdiradd();
	afx_msg void OnDestroy();
...

Works like a charm (Leak is gone). Thanks for the tutorial Leuk_he. :respect:
0

#12 User is offline   Ergol 

  • Premium Member
  • PipPipPipPipPip
  • Group: Members
  • Posts: 314
  • Joined: 07-March 03

Posted 09 January 2008 - 04:50 PM

Thanks. During test run the fix seems to be working.

Hope it helps.
0

#13 User is offline   tHeWiZaRdOfDoS 

  • He's MaGiC
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5047
  • Joined: 28-December 02

Posted 27 January 2008 - 07:07 AM

Just a note: this would be better off to be put into the CDirectoryTreeCtrl class so it will automatically be applied whereever needed.
Immagine Postata

Secure yourself using the client analyzer technology
Pimp your mod with charming, colorful modicons


This post has been edited 937 times, the last time by tHeWiZaRdOfDoS: Today, 12:27 PM
0

#14 User is offline   Enig123 

  • Magnificent Member
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 375
  • Joined: 22-November 04

Posted 27 January 2008 - 07:22 AM

WiZ, why not update your eMuleFuture CVS code (it's a long time) so we can be more clear what are you talking about?
0

#15 User is offline   tHeWiZaRdOfDoS 

  • He's MaGiC
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5047
  • Joined: 28-December 02

Posted 27 January 2008 - 08:41 AM

Currently I have neither much time nor fun working on eMule (personal problems) - I would have to check what my teammates did, first - and I simply do not want that.
However, this fix would be better put into DirectoyTreeCtrl.h:

Quote

DECLARE_MESSAGE_MAP()
afx_msg void OnDestroy(); //>>> FiX
afx_msg void OnTvnItemexpanding(NMHDR *pNMHDR, LRESULT *pResult);


and DirectoryTreeCtrl.cpp:

Quote

ON_WM_CHAR()
ON_WM_DESTROY() //>>> FiX
END_MESSAGE_MAP()

...

//>>> FiX
void CDirectoryTreeCtrl::OnDestroy()
{
HIMAGELIST handle = TreeView_GetImageList(GetSafeHwnd(), TVSIL_STATE);
if (handle != NULL)
ImageList_Destroy(handle);
}
//<<< FiX

Hope that makes it clear. Regards,
WiZ

This post has been edited by tHeWiZaRdOfDoS: 27 January 2008 - 08:44 AM

Immagine Postata

Secure yourself using the client analyzer technology
Pimp your mod with charming, colorful modicons


This post has been edited 937 times, the last time by tHeWiZaRdOfDoS: Today, 12:27 PM
0

#16 User is offline   Rapid_Mule 

  • "routing problems on the neural net"
  • PipPipPipPipPip
  • Group: Members
  • Posts: 256
  • Joined: 03-May 04

Posted 30 January 2008 - 06:52 AM

View PosttHeWiZaRdOfDoS, on Jan 27 2008, 10:41 AM, said:

Currently I have neither much time nor fun working on eMule (personal problems) - I would have to check what my teammates did, first - and I simply do not want that.
However, this fix would be better put into DirectoyTreeCtrl.h:

Quote

DECLARE_MESSAGE_MAP()
afx_msg void OnDestroy(); //>>> FiX
afx_msg void OnTvnItemexpanding(NMHDR *pNMHDR, LRESULT *pResult);


and DirectoryTreeCtrl.cpp:

Quote

ON_WM_CHAR()
ON_WM_DESTROY() //>>> FiX
END_MESSAGE_MAP()

...

//>>> FiX
void CDirectoryTreeCtrl::OnDestroy()
{
HIMAGELIST handle = TreeView_GetImageList(GetSafeHwnd(), TVSIL_STATE);
if (handle != NULL)
ImageList_Destroy(handle);
CTreeCtrl::OnDestroy(); // Avoid memleaks
}
//<<< FiX

Hope that makes it clear. Regards,
WiZ

Putting the code there works but introduced new memleaks! It seems we need to do the cleanup our self. I added CTreeCtrl::OnDestroy() after the code and I hope we finally got it.
0

#17 User is offline   tHeWiZaRdOfDoS 

  • He's MaGiC
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5047
  • Joined: 28-December 02

Posted 30 January 2008 - 07:24 AM

Of course! :angelnot:
This happens if you do not code for some months... :-k
Immagine Postata

Secure yourself using the client analyzer technology
Pimp your mod with charming, colorful modicons


This post has been edited 937 times, the last time by tHeWiZaRdOfDoS: Today, 12:27 PM
0

  • Member Options

Page 1 of 1

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users