Board index » delphi » DeleteObject & Free - freeing resource handles

DeleteObject & Free - freeing resource handles

Is it necessary to call Win API's deletobject  after loading a resource - to
free the handle - or will Delphi do it automatically when you  free the object
?

eg
if you load a bitmap like so

cbmp.Handle := LoadBitmap(HInstance, 'fred');

is it neccessary to do this

dum := deleteobject(cbmp.handle); {to release the thandle}
cbmp.free;

or will simply cbmp.free; be enough ?

TIA

Boris Ingram, Cyborg Software
boris...@iafrica.com
http://www.pcb.co.za/users/borising/cyborg.htm

 

Re:DeleteObject & Free - freeing resource handles


On Thu, 4 Apr 1996 09:17:50, boris...@iafrica.com (Boris Ingram)
wrote:

Quote
>Is it necessary to call Win API's deletobject  after loading a resource - to
>free the handle - or will Delphi do it automatically when you  free the object
>?

>eg
>if you load a bitmap like so

>cbmp.Handle := LoadBitmap(HInstance, 'fred');

>is it neccessary to do this

>dum := deleteobject(cbmp.handle); {to release the thandle}
>cbmp.free;

>or will simply cbmp.free; be enough ?

TBitmap.free frees the Windows bitmap object, too.
--
Ray Lischner                              li...@tempest-sw.com
Tempest Software, Corvallis, Oregon, USA  http://www.tempest-sw.com

Other Threads