XBROWSE memory leak - SOLVED
Posted: Wed Sep 02, 2020 9:46 pm
Sr. Antonio, utilizo la versión de FIVEWIN 17.04, y noté una pérdida de memoria en xbrowse, al usar GDIVIEW, noté que (PEN) no liberó memoria.
Quizás ya lo haya corregido, pero el problema estaba en el método:
METHOD Adjust() CLASE TXBrowse
...
//aqui***********************************
if ::hRowPen != nil
DeleteObject( ::hRowPen )
::hRowPen := nil
endif
********************************************
do case
case nStyle == LINESTYLE_BLACK .or. nStyle == LINESTYLE_RAISED .or. nStyle == LINESTYLE_INSET
::hRowPen := CreatePen( If( ::nColorPen == nil, PS_NULL, PS_SOLID ), ::nSizePen, ::nColorPen )
case nStyle == LINESTYLE_DARKGRAY
::hRowPen := CreatePen( PS_SOLID, ::nSizePen, CLR_GRAY )
case nStyle == LINESTYLE_FORECOLOR
::hRowPen := CreatePen( PS_SOLID, ::nSizePen, ::nClrText )
case nStyle == LINESTYLE_LIGHTGRAY
::hRowPen := CreatePen( PS_SOLID, ::nSizePen, CLR_LIGHTGRAY )
end case
Quizás ya lo haya corregido, pero el problema estaba en el método:
METHOD Adjust() CLASE TXBrowse
...
//aqui***********************************
if ::hRowPen != nil
DeleteObject( ::hRowPen )
::hRowPen := nil
endif
********************************************
do case
case nStyle == LINESTYLE_BLACK .or. nStyle == LINESTYLE_RAISED .or. nStyle == LINESTYLE_INSET
::hRowPen := CreatePen( If( ::nColorPen == nil, PS_NULL, PS_SOLID ), ::nSizePen, ::nColorPen )
case nStyle == LINESTYLE_DARKGRAY
::hRowPen := CreatePen( PS_SOLID, ::nSizePen, CLR_GRAY )
case nStyle == LINESTYLE_FORECOLOR
::hRowPen := CreatePen( PS_SOLID, ::nSizePen, ::nClrText )
case nStyle == LINESTYLE_LIGHTGRAY
::hRowPen := CreatePen( PS_SOLID, ::nSizePen, CLR_LIGHTGRAY )
end case