Print Page | Close Window

Leaking GDI objects

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=13777
Printed Date: 07 October 2024 at 4:20am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Leaking GDI objects
Posted By: PhilM
Subject: Leaking GDI objects
Date Posted: 24 March 2009 at 11:24am
When we load the command bars object without doing anything with it, it creates 21 GDI font objects and when deleted only clears up 5 of them so it is leaking 16 GDI font objects every time it is loaded and deleted again. Probably another problem with Openedge but thought I would mention it anyway, in case anbody knows an answer. Here is the Openedge code which causes this leak:-
 
DEFINE VAR vcmdbar AS HANDLE NO-UNDO.  
DEFINE VAR chcmdbar AS COM-HANDLE NO-UNDO.
DEFINE VAR stat AS LOG NO-UNDO.
DEFINE FRAME vframe.
  
create control-frame vCmdBar assign
    frame = FRAME vFrame:HANDLE
    name = "CommandBars":u
    HEIGHT-PIXELS = 1
    WIDTH-PIXELS = 1
    hidden = NO
    sensitive = YES.
   
assign 
    chCmdBar = vCmdBar:com-handle
    stat     = chCmdBar:LoadControls( "cmdbar.wrx" , "CommandBars":u).
DELETE WIDGET vcmdbar.
 
Also if you set the visual theme to office2003 it will leak an extra 2 GDI bitmaps and 2 GDI DC's.
 
This also occurs with the Docking pane object but that only leaks 12 GDI font objects.
 
If anybody has any solutions to this it would a great help as this means our screen will use up the GDI resources if it is opened a lot of times, OK the limit per process is 10000 on my PC so with 1 command bar and 2 docking panes I only leak 40 objects each time which means I would have to run it 250 times in one session before it will crash but this isn't very good practice.
 
Thanks


-------------
Product: Xtreme SuitePro (ActiveX) version 17.3.0

Platform: Windows 10 / Windows 7

Language: Openedge 11.6




Replies:
Posted By: PhilM
Date Posted: 26 March 2009 at 11:08am
We have now fixed this issue by using the FRAME versions of these objects. Must be a problem with the way Openedge/Progress loads and destroys things.

-------------
Product: Xtreme SuitePro (ActiveX) version 17.3.0

Platform: Windows 10 / Windows 7

Language: Openedge 11.6




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net