Re: Component Resource Usage

From: Francis (francisbrightman_at_rwfts.com)
Date: 10/13/04


Date: 13 Oct 2004 04:36:17 -0700

I didn't write the component. Its called fancybutton and the
destructor looks like this:

destructor TDsFancyButton.Destroy;
begin
  DeleteObject(FRgn);
  DeleteObject(MRgn);
  inherited Destroy;
end;

( FRgn, MRgn: HRgn; // region, detect mouse move and position)

Francis

"Bruce Roberts" <ber@bounceitattcanada.xnet> wrote in message news:<KISad.23$XE3.46952@news20.bellglobal.com>...
> "Francis" <francisbrightman@rwfts.com> wrote in message
> news:e04f12bf.0410120546.31267f26@posting.google.com...
> > I am using a custom button component in a test program and am
> > wondering how to free the resources used by this component reliably?
> > When testing the program in memproof I can see that GDI region
> > resource count just continues to increase when I create and destroy
> > the form that these buttons are on, even though I am using the create
> > and free method for creating the form.
>
> Since you don't give any information on the custom button component it is
> difficult to make any suggestions. Is this a component you have written? If
> so, use the destructor to release any resources the component has acquired.