[i18n] Memory leak when LangComboBox load TFlagsImageList

Please post bug reports, feature requests, or any question regarding the DELPHI AREA projects here.

[i18n] Memory leak when LangComboBox load TFlagsImageList

Postby arhangelsoft » January 30th, 2014, 9:34 pm

Greetings, Kambiz!

I catch bugreport about memory leaks. But I can't found where HBITMAP drops....
See call-stack(read down-up):
Code: Select all
allocation number: 97967
program up time: 2,51 s
type: Bitmap Handle
handle: $535e8
dimensions: 16x11
bitdepth: 32

main thread ($1b24):
00581b9e MyApp.exe Vcl.Graphics        7610 CopyBitmap
00582587 MyApp.exe Vcl.Graphics        7965 TBitmap.CopyImage
00584623 MyApp.exe Vcl.Graphics        9717 TBitmap.SetSize
00583e83 MyApp.exe Vcl.Graphics        9307 TBitmap.SetHeight
006ef42e MyApp.exe i18nCtrls           7949 TCustomFlagImageList.NormalizeImage
006ef621 MyApp.exe i18nCtrls           7991 TCustomFlagImageList.NormalizeFlag
006ef682 MyApp.exe i18nCtrls           7999 TCustomFlagImageList.AddFlag
006efd2a MyApp.exe i18nCtrls           8067 TCustomResFlagImageList.AddFlagFromResource
006efc7f MyApp.exe i18nCtrls           8053 EnumBitmapsCallback
7583849e KERNELBASE.dll                                  EnumResourceNamesExW
756d5c4e KERNEL32.DLL                                    EnumResourceNamesW
006efdaa MyApp.exe i18nCtrls           8077 TCustomResFlagImageList.PrepareFlags
006ef2c7 MyApp.exe i18nCtrls           7892 TCustomFlagImageList.Create
00534639 MyApp.exe System.Classes     10140 CreateComponent
00534864 MyApp.exe System.Classes     10186 TReader.ReadComponent
00534b15 MyApp.exe System.Classes     10252 TReader.ReadDataInner
00534a54 MyApp.exe System.Classes     10231 TReader.ReadData
0053f931 MyApp.exe System.Classes     15799 TComponent.ReadState
0052f826 MyApp.exe System.Classes      8277 TStream.ReadComponent
005250c7 MyApp.exe System.Classes      3828 InternalReadComponentRes
00526a1b MyApp.exe System.Classes      3885 InitComponent
00526aa9 MyApp.exe System.Classes      3897 InitInheritedComponent
005412cc MyApp.exe System.Classes     16635 TDataModule.Create
00681d76 MyApp.exe Vcl.Forms          10407 TApplication.CreateForm
0091ff2a MyApp.exe MyApp    56 initialization
756c495b KERNEL32.DLL                                    BaseThreadInitThunk


count of leaks == number of supported translations & showed language flags in combobox.

Maybe you can help resolve that... :)
arhangelsoft
Junior Member
Junior Member
 
Posts: 39
Joined: February 16th, 2012, 9:56 pm
Location: Belarus, Minsk

Re: [i18n] Memory leak when LangComboBox load TFlagsImageLis

Postby Kambiz » February 3rd, 2014, 5:58 pm

Hi,

I checked my code again. In every location that I've created an image handle, I've released it. I haven't only released the handles which are passed to the underlying Windows image list because the image list owns these handles.

Is it possible that the memory leak be a false report?
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Re: [i18n] Memory leak when LangComboBox load TFlagsImageLis

Postby arhangelsoft » February 11th, 2014, 8:49 pm

Hi, this isn't memory leak, it's resource leak. I tried to use EurekaLog, FastMM, JclDebug, etc tools fo detect this...
None of it didn't found problem, I think so that is a fake detection of MadExcept.

Can you please check again that? but now search resource leak problem. Maybe HBITMAP somewhere drops...
arhangelsoft
Junior Member
Junior Member
 
Posts: 39
Joined: February 16th, 2012, 9:56 pm
Location: Belarus, Minsk

Re: [i18n] Memory leak when LangComboBox load TFlagsImageLis

Postby Kambiz » February 16th, 2014, 10:34 am

Last time I looked for image handle leaks and found nothing.

It could be also a bug in a specific Delphi version. Do you have chance to test on different version of Delphi?
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Re: [i18n] Memory leak when LangComboBox load TFlagsImageLis

Postby arhangelsoft » February 16th, 2014, 10:43 am

No, I don't have any older or newer version of Delphi.
You can test it by yourself. Just install MadExcept, and in it options for project(Project -> MadExcept Options...), mark "report resource leaks"
arhangelsoft
Junior Member
Junior Member
 
Posts: 39
Joined: February 16th, 2012, 9:56 pm
Location: Belarus, Minsk

Re: [i18n] Memory leak when LangComboBox load TFlagsImageLis

Postby Kambiz » February 17th, 2014, 4:39 pm

I have only Delphi 7.
My trial XE5 is expired.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm


Return to DELPHI AREA Projects

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron