FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Leak on TRibbon?
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Leak on TRibbon?
Posted: Fri Jun 14, 2013 08:58 AM
Antonio, should not the hBmp deleted unstead hBmpOld ???

Function from tRibbon:

Code (fw): Select all Collapse
function GradientBmp( oWnd, nWidth, nHeight, aColors )

   local hDC, hBmp, hBmpOld
   local aRect := GetClientRect( oWnd:hWnd )

   DEFAULT nHeight := aRect[ 3 ] , nWidth := aRect[ 4 ]

   hDC     = CreateCompatibleDC( oWnd:GetDC() )
   hBmp    = CreateCompatibleBitMap( oWnd:hDC, nWidth, nHeight )
   hBmpOld = SelectObject( hDC, hBmp )
   GradientFill( hDC, 0, 0, nHeight, nWidth, aColors )

   SelectObject( hDC, hBmpOld )
   DeleteDC( hDC )
   DeleteObject( hBmpOld ) //-------->>>>> DeleteObject( hBmp )
   oWnd:ReleaseDC()

return hBmp
Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: Leak on TRibbon?
Posted: Fri Jun 14, 2013 10:18 AM

No, my mistake!! The hBmp is the value to return!

But another growing GDI-consum i saw. In TQuickaccess the GDI-bmps are growing, if i stand with the mouse over one of the quickaccess-controls ( all ~seconds +1 GDI-object more)
Also at end from app when i check with checkres() there are three bmp from quickaccess unreleased!

Regards,
Günther
---------------------------------
office@byte-one.com

Continue the discussion