Major bug in resource management
Moderator: Rathinagiri
Re: Major bug in resource management
Hello Grigory !
Yes ty, it helps a lot ... but the GDI handles a still increasing, but slower. So i have to find other code bugs
I will report when I found them.
Regards ... Ricci
Yes ty, it helps a lot ... but the GDI handles a still increasing, but slower. So i have to find other code bugs
I will report when I found them.
Regards ... Ricci
Re: Major bug in resource management
Grigory, here is the next one to fix:
The command <ParentWindowName>.<ControlName>.Picture := cImageName for an IMAGE control increase the GDI handles with 1
Regards ... Ricci
The command <ParentWindowName>.<ControlName>.Picture := cImageName for an IMAGE control increase the GDI handles with 1
Regards ... Ricci
Last edited by Ricci on Thu Jul 29, 2010 8:50 pm, edited 2 times in total.
Re: Major bug in resource management
Hello, Grigory !
Here are some more:
When creating a sub-window with DEFINE WINDOW <WindowName> and closing it with <WindowName>.Release you loose 2 GDI handles every time.
If you create a grafical Button is the window above with BUTTON <ControlName> ... PICTURE <cPictureName> you loose 4 GDI handles more when closing the window.
Enough for today ...
Regards ... Ricci
Here are some more:
When creating a sub-window with DEFINE WINDOW <WindowName> and closing it with <WindowName>.Release you loose 2 GDI handles every time.
If you create a grafical Button is the window above with BUTTON <ControlName> ... PICTURE <cPictureName> you loose 4 GDI handles more when closing the window.
Enough for today ...
Regards ... Ricci
- dhaine_adp
- Posts: 457
- Joined: Wed Aug 06, 2008 12:22 pm
- Location: Manila, Philippines
Re: Major bug in resource management
Hello Grigory,IMAGELIST_DESTROY ( _HMG_SYSDATA [ 37 ] [y] ) in the h_controlmisc.prg and recompile HMG library by batch file hmg\source\makehmg.bat.
Thank you for posting the patch. Very fast indeed.
Regards,
Danny
Regards,
Danny
Manila, Philippines
Danny
Manila, Philippines
Re: Major bug in resource management
Ok, i found the solution for the increasing GDI handles using the command <ParentWindowName>.<ControlName>.Picture := cImageName for an IMAGE control.
In c_image.c there is a HDC defined with
HDC tmp2DC = CreateCompatibleDC(imgDC);
but it´s not always deleted at the end of the function.
Here is the corrected file.
Regards ... Ricci
In c_image.c there is a HDC defined with
HDC tmp2DC = CreateCompatibleDC(imgDC);
but it´s not always deleted at the end of the function.
Here is the corrected file.
Regards ... Ricci
- Attachments
-
- c_image-upd.zip
- (2.89 KiB) Downloaded 264 times
Re: Major bug in resource management
And another problem solved.
If you create a grafical button in a subwindow with BUTTON <ControlName> ... PICTURE <cPictureName> you loose 4 GDI handles more when releasing the window.
Here is the corrected file (I added some code at line number 2959)
Regard ... Ricci
If you create a grafical button in a subwindow with BUTTON <ControlName> ... PICTURE <cPictureName> you loose 4 GDI handles more when releasing the window.
Here is the corrected file (I added some code at line number 2959)
Regard ... Ricci
- Attachments
-
- h_windows-upd.zip
- (26.63 KiB) Downloaded 277 times
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Major bug in resource management
Thanks Ricci.
Let Roberto reviews the code and accommodates the changes.
Let Roberto reviews the code and accommodates the changes.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: Major bug in resource management
Now we only need a fix for the last error:rathinagiri wrote:Thanks Ricci.
Let Roberto reviews the code and accommodates the changes.
When creating a sub-window with DEFINE WINDOW <WindowName> and closing it with <WindowName>.Release you loose 2 GDI handles every time.
Re: Major bug in resource management
I was able to localize the error above but unable to fix it. A job for Grigory or Roberto this timeRicci wrote:When creating a sub-window with DEFINE WINDOW <WindowName> and closing it with <WindowName>.Release you loose 2 GDI handles every time.
If you open a subwindow with this command:
Code: Select all
DEFINE WINDOW Form_2 ;
AT 100,100 WIDTH 200 HEIGHT 100
END WINDOW
ACTIVATE WINDOW Form_2
So this is OK.
Defining the window as MODAL, the behavior is changing:
Code: Select all
DEFINE WINDOW Form_2 ;
AT 100,100 WIDTH 200 HEIGHT 100 MODAL
END WINDOW
ACTIVATE WINDOW Form_2
So the program consume 2 GDI handles re(opening) and closing MODAL windows. Sounds little, but if you work a long time with a program it could be too much.
Regards ... Ricci
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Major bug in resource management
I'll do ASAP.rathinagiri wrote:Thanks Ricci.
Let Roberto reviews the code and accommodates the changes.
Thanks!!!
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)