I have found some bugs that cause GDI objects leaks.
TTreeVie.prg:
- Code: Select all Expand view RUN
METHOD SetColor( nClrText, nClrPane ) INLINE ;
Super:SetColor( nClrText, nClrPane ), TVSetColor( ::hWnd, nClrText, nClrPane )
TVSetColor increment by two the GDI objects (two brushes) in use without decrement when destroy the TreeView. If you don't use custom color for the treeview you can don't call TVSetColor so I've change in:
- Code: Select all Expand view RUN
METHOD SetColor( nClrText, nClrPane ) CLASS TTreeView
Super:SetColor( nClrText, nClrPane )
IF !Empty(::hWnd) .AND. ( nClrText != ::oWnd:nClrText .OR. nClrPane != GetSysColor(COLOR_WINDOW) )
TVSetColor( ::hWnd, nClrText, nClrPane )
ENDIF
RETURN NIL
If you use a ImageList with the TreeView it's not destroyed when you destroy the TreeView so I've add the method Destroy:
- Code: Select all Expand view RUN
METHOD Destroy() CLASS TTreeView
IF !Empty(::oImageList)
::oImageList:End()
ENDIF
RETURN Super:Destroy()
BtnBmp.prg
In the method LoadBitmaps there's no call to FreeBitmaps, so if you change the bitmaps at run-time it will open the new bitmaps without closing the others.
xBrowse.prg
Sometimes the method End isn't called when you close the dialog. I add a inline method destroy:
- Code: Select all Expand view RUN
METHOD Destroy() INLINE ::End()
In the End method of TXBrwColumn class there is the DeleteObject of the bitmaps you used. But there isn't the DeleteObject of the bitmap's palette.
- Code: Select all Expand view RUN
DeleteObject( ::aBitmaps[ nFor, BITMAP_PALETTE ] )
In the SetArray method if you use lAutoOrder two bitmaps (created by FwBmpAsc() and FwBmpDes()) are added to each column. It is not necessary, you can create the two bitmap handles when create the xBrowse and use the same for each column or create when your application start and use the same for each column of each xbrowse.
Thanks
Patrizio