Re: [press-support-br] Implementar Destructor
Status: Pre-Alpha
Brought to you by:
jcmoraisjr
From: Joao M. <jcm...@gm...> - 2011-09-25 17:31:10
|
On Sun, Sep 25, 2011 at 12:36, Luciano Donato <lu...@do...> wrote: > Gostaria de implementar algumas coisa no destruidor do objeto, porém: > tento fazer: > > public > destructor Destroy; override; > > O Lazarus me informa: > > Error: There is no method in an ancestor class to be overridden: > "destructor TObjeto.Destroy;" > > Todas as classe não possui o metódo Destroy? > > como posso fazer isso? O destructor no Press deixou de ser virtual (reintroduce fez isto) porque não é a forma garantida de interceptar código na destruição de objetos. Ao invés, sobrescreva o método protected "Finit". Mais a respeito do porque desta abordagem: http://blog.joaomorais.com.br/2008/09/06/objetos-contagem-ref.html Joao Morais |