Board index » delphi » OnClose: EPGFault occurs

OnClose: EPGFault occurs

Hi,

I always get an EPGFault on closing my application (SDI) by closing the

form ( Form1.Close; ). I think it has to do with new components I create

on runtime: I only get this EPGFault, if I set the Parent-Property of

the new components (inherited from TShape) to a TabbedNotebook-Component

on my form. If I just create them without setting the ParentProp no
Error occurs.
Thanks for any suggestions!
Stefan Biesdorf

 

Re:OnClose: EPGFault occurs


BinGo <u722...@lrz.uni-muenchen.de> wrote in article
<3338FEED.1...@lrz.uni-muenchen.de>...

Quote
> Hi,

> I always get an EPGFault on closing my application (SDI) by closing the

> form ( Form1.Close; ). I think it has to do with new components I create

> on runtime: I only get this EPGFault, if I set the Parent-Property of

> the new components (inherited from TShape) to a TabbedNotebook-Component

> on my form. If I just create them without setting the ParentProp no
> Error occurs.

This sounds like a component that already has been freed is 'freed' a
second
time. Do you explicitly free the run-time created components? If the parent
property is set, the parent will free them for you.

Wim

Re:OnClose: EPGFault occurs


In article <3338FEED.1...@lrz.uni-muenchen.de>,
   BinGo <u722...@lrz.uni-muenchen.de> wrote:
]-Hi,
]-
]-I always get an EPGFault on closing my application (SDI) by closing the
]-
]-form ( Form1.Close; ). I think it has to do with new components I create
]-
]-on runtime: I only get this EPGFault, if I set the Parent-Property of
]-
]-the new components (inherited from TShape) to a TabbedNotebook-Component
]-
]-on my form. If I just create them without setting the ParentProp no
]-Error occurs.

sounds like you're destroying your TShape components twice  (the
second attempt is the one that generates the GPF...)

here's a quote from the on-line help that may clarify the situation
<QUOTE>
  When the parent of a control is destroyed, all controls that are
  its children are also destroyed.
</QUOTE>

Mark Vaughan

]-Thanks for any suggestions!
]-Stefan Biesdorf

Other Threads