Memory leak with MENU 2007

Memory leak with MENU 2007

Postby IBTC » Sun Feb 13, 2011 12:36 am

Hello!

Code:

Code: Select all  Expand view

FUNCTION MAIN()

   LOCAL oWnd

   SetResDebug()

   DEFINE WINDOW oWnd FROM 1, 1 TO 22, 75 ;
      TITLE "Test";
      MENU BuildMenu()

   ACTIVATE WINDOW oWnd

   FERASE("CHECKRES.TXT")
   CHECKRES()
   winExec("notepad .\checkres.txt")

return(0)

function BuildMenu()

   local oMenu

   MENU oMenu 2007

      MENUITEM "Item 1"

         MENU

            MENUITEM "Item 1.1"
            MENUITEM "Item 1.2"

            MENU
               MENUITEM "Item 1.2a"
               MENUITEM "Item 1.2b"
            ENDMENU

            MENUITEM "Item 1.3"

            MENU
               MENUITEM "Item 1.3a"
               MENUITEM "Item 1.3b"
            ENDMENU

         ENDMENU

   ENDMENU

return oMenu

 


Checkres.txt:

Code: Select all  Expand view

02/13/11 01:35:21: BMP,1568,TWINDOW:HANDLEEVENT(0)->_FWH(3394)->SHOWWINDOW(0)->TWINDOW:ACTIVATE(961)->MAIN(29)
 


With only

Code: Select all  Expand view
MENU oMenu


there is no problem.
Best Regards,
Ruediger Alich

---
HMG 3.1.3 | FTDN/FWH 13.12 | Harbour 3.2 | BCC/MinGW | Windows XP/Vista/7/8/10 (32/64-Bit), Wine (Linux/Mac) - started 1999 with FW, 1989 with Clipper
User avatar
IBTC
 
Posts: 103
Joined: Sat Oct 18, 2008 8:13 pm
Location: Stuttgart, Germany

Re: Memory leak with MENU 2007

Postby James Bott » Sun Feb 13, 2011 7:23 am

See this thread: viewtopic.php?f=3&t=20788
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Memory leak with MENU 2007

Postby nageswaragunupudi » Sun Feb 13, 2011 7:49 am

I too confirm this problem.

Mr.James
This issue was not discussed and solved in the other posting you are referring to. This is yet to be fixed.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Memory leak with MENU 2007

Postby Antonio Linares » Sun Feb 13, 2011 8:56 am

Ruediger,

Already fixed and included for next FWH build, thanks! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42082
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Memory leak with MENU 2007

Postby Richard Chidiak » Sun Feb 13, 2011 9:00 am

Antonio

TBTNBMP does not release fonts also,

Will the fix for this class be included in next fwh release ?

Thanks

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: Memory leak with MENU 2007

Postby Antonio Linares » Sun Feb 13, 2011 9:40 am

Richard,

Please comment out this entire section from Class TBtnBmp Method Paint():
Code: Select all  Expand view
 /*
   if ::lBarBtn
      ::l2007 = ::oWnd:l2007
      if ::oFont == NIL
         if ::oWnd:oFont != nil
            if ::oWnd:oFont:cFaceName != "Tahoma"
               DEFINE FONT oFont NAME "Tahoma" SIZE 0, -11
               ::oWnd:SetFont( oFont )
            endif
            ::SetFont( ::oWnd:oFont )
         else
            DEFINE FONT oFont NAME "Tahoma" SIZE 0, -11
            ::SetFont( oFont )
         endif
      else
         ::oWnd:SetFont( ::oFont )
      endif
   else
      if ::oFont == nil
         ::SetFont( ::oWnd:oFont )
         if ::oFont == nil .and. ! Empty( ::oWnd )
           ::SetFont( ::oWnd:oWnd:oFont )
         endif
      else
         ::SetFont( ::oFont )
      endif
   endif
   */

 

as fonts should not be created from the Paint method, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42082
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Memory leak with MENU 2007

Postby IBTC » Sun Feb 13, 2011 10:06 am

Hi Antonio,

Antonio Linares wrote:Already fixed and included for next FWH build, thanks!


No worries. Thanks for the quick help. :D
Best Regards,
Ruediger Alich

---
HMG 3.1.3 | FTDN/FWH 13.12 | Harbour 3.2 | BCC/MinGW | Windows XP/Vista/7/8/10 (32/64-Bit), Wine (Linux/Mac) - started 1999 with FW, 1989 with Clipper
User avatar
IBTC
 
Posts: 103
Joined: Sat Oct 18, 2008 8:13 pm
Location: Stuttgart, Germany

Re: Memory leak with MENU 2007

Postby IBTC » Mon Feb 14, 2011 8:07 pm

Hi Antonio,

Antonio Linares wrote:Already fixed and included for next FWH build


Is it possible that the problem still exists in FWH 11.01 or maybe there is another problem?

Is still get with FWH 11.01:

Code: Select all  Expand view
02/14/11 21:01:59: BMP,1568,TWINDOW:HANDLEEVENT(0)->_FWH(3408)->SHOWWINDOW(0)->TWINDOW:ACTIVATE(975)->MAIN(14)


BTW... I only have the prg file without a rc/manifest file.
Best Regards,
Ruediger Alich

---
HMG 3.1.3 | FTDN/FWH 13.12 | Harbour 3.2 | BCC/MinGW | Windows XP/Vista/7/8/10 (32/64-Bit), Wine (Linux/Mac) - started 1999 with FW, 1989 with Clipper
User avatar
IBTC
 
Posts: 103
Joined: Sat Oct 18, 2008 8:13 pm
Location: Stuttgart, Germany

Re: Memory leak with MENU 2007

Postby Daniel Garcia-Gil » Tue Mar 15, 2011 11:23 pm

Ruediger...

it's is a VERY INOFFENSIVE memory leak... this gdi object is created only one time to build 2007 menu effect... dont worry about that...
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Memory leak with MENU 2007

Postby IBTC » Thu Mar 17, 2011 10:21 pm

Hi Daniel,

Daniel Garcia-Gil wrote:this gdi object is created only one time to build 2007 menu effect... dont worry about that...


But I am worried about, because I made more tests with FWH 11.01. And everytime a POPUP MENU is called there is 1 unreleased gdi object more. So if my customers start my app, work some hours with it and call a POPUP MENU e.g. about 100 times, there are about 100 unreleased gdi objects. This is not acceptable.

Code: Select all  Expand view
//----------------------------------------------------------------------------//

FUNCTION MAIN()

   LOCAL oWnd

   SetResDebug()

   DEFINE WINDOW oWnd FROM 1, 1 TO 22, 75 ;
      TITLE "Test";
      MENU BuildMenu()

   ACTIVATE WINDOW oWnd;
         ON RIGHT CLICK ShortMainMenu(oWnd)

   FERASE("CHECKRES.TXT")
   CHECKRES()
   winExec("notepad .\checkres.txt")

return(0)

//----------------------------------------------------------------------------//

function ShortMainMenu(oWnd)

   local oMenu, aPos

   aPos := ScreenToClient( oWnd:hWnd, GetCursorPos() )

   MENU oMenu POPUP 2007

      MENUITEM "Item 1"

   ENDMENU

   activate popup oMenu of oWnd at aPos[1], aPos[2]

return oMenu

function BuildMenu()

   local oMenu

   MENU oMenu 2007

      MENUITEM "Item 1"

   ENDMENU

return oMenu

//----------------------------------------------------------------------------//


If I call the popup menu with right click e.g. 5 times, I get this:

Code: Select all  Expand view
03/17/11 23:14:30: BMP,1568,TWINDOW:HANDLEEVENT(0)->_FWH(3408)->SHOWWINDOW(0)->TWINDOW:ACTIVATE(975)->MAIN(17)
   
03/17/11 23:14:30: BMP,2160,TWINDOW:HANDLEEVENT(0)->_FWH(3408)->TRACKPOPUP(0)->TMENU:ACTIVATE(470)->SHORTMAINMENU(39)->(b)MAIN(17)->TWINDOW:RBUTTONDOWN(1907)->TWINDOW:HANDLEEVENT(0)->_FWH(3408)->WINRUN(0)->TWINDOW:ACTIVATE(992)->MAIN(17)
   
03/17/11 23:14:30: BMP,2532,TWINDOW:HANDLEEVENT(0)->_FWH(3408)->TRACKPOPUP(0)->TMENU:ACTIVATE(470)->SHORTMAINMENU(39)->(b)MAIN(17)->TWINDOW:RBUTTONDOWN(1907)->TWINDOW:HANDLEEVENT(0)->_FWH(3408)->WINRUN(0)->TWINDOW:ACTIVATE(992)->MAIN(17)
   
03/17/11 23:14:30: BMP,2880,TWINDOW:HANDLEEVENT(0)->_FWH(3408)->TRACKPOPUP(0)->TMENU:ACTIVATE(470)->SHORTMAINMENU(39)->(b)MAIN(17)->TWINDOW:RBUTTONDOWN(1907)->TWINDOW:HANDLEEVENT(0)->_FWH(3408)->WINRUN(0)->TWINDOW:ACTIVATE(992)->MAIN(17)
   
03/17/11 23:14:30: BMP,3140,TWINDOW:HANDLEEVENT(0)->_FWH(3408)->TRACKPOPUP(0)->TMENU:ACTIVATE(470)->SHORTMAINMENU(39)->(b)MAIN(17)->TWINDOW:RBUTTONDOWN(1907)->TWINDOW:HANDLEEVENT(0)->_FWH(3408)->WINRUN(0)->TWINDOW:ACTIVATE(992)->MAIN(17)
   
03/17/11 23:14:30: ====================================================================================================
Best Regards,
Ruediger Alich

---
HMG 3.1.3 | FTDN/FWH 13.12 | Harbour 3.2 | BCC/MinGW | Windows XP/Vista/7/8/10 (32/64-Bit), Wine (Linux/Mac) - started 1999 with FW, 1989 with Clipper
User avatar
IBTC
 
Posts: 103
Joined: Sat Oct 18, 2008 8:13 pm
Location: Stuttgart, Germany

Re: Memory leak with MENU 2007

Postby Daniel Garcia-Gil » Fri Mar 18, 2011 12:07 am

Yes...

we will fix soon


thanks for feedback
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Memory leak with MENU 2007

Postby Antonio Linares » Mon Mar 28, 2011 11:18 am

Ruediger,

Do you get the same without using 2007 in the popup menu creation ? thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42082
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Memory leak with MENU 2007

Postby Antonio Linares » Mon Mar 28, 2011 11:40 am

Yes, it is the 2007 clause...

searching...
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42082
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Memory leak with MENU 2007

Postby Antonio Linares » Mon Mar 28, 2011 11:53 am

* Fix: Clause 2007 was releasing a bitmap but not removing it from the FWH list. Now it is ok.
(still a pending one there). FWH 11.03
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42082
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 111 guests