[fpc-devel] ShowModal / Application.Idle problem

Mattias Gaertner nc-gaertnma at netcologne.de
Tue Nov 20 01:14:27 CET 2007


On Tue, 20 Nov 2007 00:08:20 +0300
Andrey Gusev <ag888 at rambler.ru> wrote:

> * Andrey Gusev <ag888 at rambler.ru> [Fri, 16 Nov 2007 17:35:26 +0300]:
> 
> Can anybody explain to me, why dynamically created forms with 
> TApplicationProperties.OnIdle(),
> incline to AV ??? 

Because the destructor was missing. I added it, so the
TApplicationProperties now unset the events on destruction.


> With Delphi it was impeccability !
> Please see attached sample. Stack backtrace included.
> 
> --------------------
> first message
> 
> > TCustomForm.ShowModal() implementation have call to
> > Application.Idle() after closing form, for what ??

You misunderstood the code: TCustomForm.ShowModal only calls Idle if
*not* closing. See your backtraces: It's the normal Application that
calls Idle.


> > background:  My some forms idle tasks have appeal to form's visual
> > components, so i got AV.
> > I use standart TApplicationProperties.OnIdle() event.
> > I can, sure, implement closing checking myself in my forms, but,
> > i sure,
> 
> now only: it seems
> 
> > ShowModal() is erroneous to call
> > Application.Idle() after form closing.
> 
> --------
> later
> 
> > Or, probably, TApplicationProperties component implementation 
> erroneous
> > - there must form closing checked ?
> 
> rather: form existence

Note: TApplicationProperties should be changed to use the handler
lists (e.g. AddOnIdleHandler) instead of the global events. At the
moment there can only be one TApplicationProperties at a time.


Mattias
 



More information about the fpc-devel mailing list