Martin,
Even doesn't changing the Owner, the problem still..
O forgot to mention the content of ChangeOwner function
?procedure ChangeOwner(AComponente, NewOwner: TComponent);
?begin
??? AComponente.Owner.RemoveComponent(AComponente);
??? NewOwner.InsertComponent(AComponente);
?end;
I suppose this function will handle all Notification changes, isn't ?
?
[]s Daniel
Conhe?a o Projeto ACBr - Automa?ao Comercial Brasil DJSystem a Loja Patrocinadora do ACBr
Show quoted text 16 lines
________________________________
De: Martin
Para: Daniel Simoes de Ameida ; Lazarus mailing list
Enviadas: Sexta-feira, 30 de Mar?o de 2012 13:49
Assunto: Re: [Lazarus] SIGSEGV with Debug only
On 30/03/2012 17:14, Daniel Simoes de Ameida wrote:
>
>Martin,
>
>
>I use a Tab Style interface... (TDI)... so, I change the Owner/Parent in this function:
>
>
....
? APage??????????? := TFormPage.Create(nbForms) ;? // This will call TFormPage.SetAForm
>
....
Show quoted text 22 lines
>
>
>
>procedure TFormPage.SetAForm(const AValue : TForm) ;
>begin
>? fsAForm := AValue ;
>
>? Caption := fsAForm.Caption;
>? Color?? := fsAForm.Color;
>
>? fsAForm.BorderStyle := bsNone ;??????
>? fsAForm.Align?????? := alClient ;?
>
>? // Change? Aform Owner and Parent
>? fsAForm.Parent := Self;
>? ChangeOwner(fsAForm, Self);
>? //? AForm.FreeNotification(APage);
>
I can't tell you 100% certain if this is related, but there is a
chance it is to do with? http://bugs.freepascal.org/view.php?id=21458
Setting the Owner of a component, does call Notify with opRemove?
and that breaks the FreeNotification system.
Whenever the LCL sets a component to know about another it uses
FreeNotification. So if one of the 2 is destroyed, the other one is informed and wiss not attempt to access the destroyed component.
That also happens for anchors(since the 2 anchored components know
about each other, they need to know, if one is destroyed)
Due to the bug I mentioned, if you chang the owner, those
notifications may no longer work. Depending on the order of calls and who knows whom, that can cause such a crash.
Do you need to change the owner, or can you live with changing the
parent only?
The parent should be enough for displaying it.
One of the things the owner will do, is clean up: if the owner is
destroyed, so is the owned component.
Show quoted text 7 lines
Maybe you can own things by the application?
?? ? APage??????????? := TFormPage.Create(Application) ;?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120330/af5f3c09/attachment.html>