Share via


Overview | Methods | Fields | This Package | All Packages

OverviewMethodsFieldsThis PackageAll Packages

Font.destroyHandle

Called when this object is going to destroy its Win32 handle.

Syntax

protected void destroyHandle()

Remarks

The Font class' implementation of the destroyHandle method frees only handles owned by the Font object. If you have used the object to retrieve a handle to this font (using the copyHandle method), or if you have created a Font object based on a previously allocated handle, this handle is not freed by the object's call to destroyHandle; you are responsible for freeing these handles.

However, you can override this method in your Font-derived class to define your own custom semantics for handle creation and destruction.

The default implementation of this method calls the appropriate Win32 method to destroy the handle if the object currently owns the handle. The method does nothing if the handle is not owned by this object.

A Font object can have more than one handle associated with it. This method is called when all of the handles associated with the Font object should be destroyed.