<html><body><div style="color:#000; background-color:#fff; font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt"><div><span>Martin,</span></div><div><br></div><div>Even doesn't changing the Owner, the problem still..</div><div><br><span></span></div><div><span>O forgot to mention the content of ChangeOwner function</span></div><div><br><span></span></div><div><span> procedure ChangeOwner(AComponente, NewOwner: TComponent);<br> begin<br> AComponente.Owner.RemoveComponent(AComponente);<br> NewOwner.InsertComponent(AComponente);<br> end;</span><span></span></div><div><br><span></span></div><div><span>I suppose this function will handle all Notification changes, isn't ?<br></span></div><div> </div><div>[]s Daniel<br><br>Conheça o <a rel="nofollow" target="_blank" href="http://acbr.sourceforge.net">Projeto ACBr - Automaçao Comercial Brasil</a><br><a rel="nofollow"
target="_blank" href="http://www.djsystem.com.br"><span style="font-weight:bold;">DJSystem</span> a Loja Patrocinadora do ACBr</a><br><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; margin-top: 5px; padding-left: 5px;"> <div style="font-family: Courier New, courier, monaco, monospace, sans-serif; font-size: 10pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1"> <b><span style="font-weight:bold;">De:</span></b> Martin <lazarus@mfriebe.de><br> <b><span style="font-weight: bold;">Para:</span></b> Daniel Simoes de Ameida <dopidaniel@yahoo.com.br>; Lazarus mailing list <lazarus@lists.lazarus.freepascal.org> <br> <b><span style="font-weight: bold;">Enviadas:</span></b> Sexta-feira, 30 de Março de 2012 13:49<br> <b><span style="font-weight: bold;">Assunto:</span></b> Re: [Lazarus] SIGSEGV with Debug only<br>
</font> </div> <br><div id="yiv1829995034">
<div>
On 30/03/2012 17:14, Daniel Simoes de Ameida wrote:
<blockquote type="cite">
<div style="color:rgb(0, 0, 0);background-color:rgb(255, 255,
255);font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt;"><br>
<div>Martin,</div>
<div><br>
</div>
<div> I use a <a rel="nofollow" target="_blank" href="http://blog.djsystem.com.br/">Tab Style interface</a>...
(TDI)... so, I change the Owner/Parent in this function:</div>
<div><br>
</div>
</div>
</blockquote>
....<br>
<blockquote type="cite"> APage :=
TFormPage.Create(nbForms) ; // This will call TFormPage.SetAForm<br>
</blockquote>
....<br>
<br>
<blockquote type="cite">
<div style="color:#000;background-color:#fff;font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt;"><br>
<div><br>
</div>
<div>procedure TFormPage.SetAForm(const AValue : TForm) ;<br>
begin<br>
fsAForm := AValue ;<br>
<br>
Caption := fsAForm.Caption;<br>
Color := fsAForm.Color;<br>
<br>
fsAForm.BorderStyle := bsNone ; <br>
fsAForm.Align := alClient ; <br>
<br>
// Change Aform Owner and Parent<br>
fsAForm.Parent := Self;<br>
ChangeOwner(fsAForm, Self);<br>
// AForm.FreeNotification(APage);<br>
</div>
</div>
</blockquote>
<br>
I can't tell you 100% certain if this is related, but there is a
chance it is to do with
<a rel="nofollow" class="yiv1829995034moz-txt-link-freetext" target="_blank" href="http://bugs.freepascal.org/view.php?id=21458">http://bugs.freepascal.org/view.php?id=21458</a><br>
<br>
Setting the Owner of a component, does call Notify with opRemove
and that breaks the FreeNotification system.<br>
<br>
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.<br>
<br>
That also happens for anchors(since the 2 anchored components know
about each other, they need to know, if one is destroyed)<br>
<br>
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.<br>
<br>
Do you need to change the owner, or can you live with changing the
parent only?<br>
<br>
The parent should be enough for displaying it.<br>
<br>
One of the things the owner will do, is clean up: if the owner is
destroyed, so is the owned component.<br>
Maybe you can own things by the application?<br>
APage := TFormPage.Create(Application) ; <br>
<br>
<br>
</div>
</div><br><br> </div> </div> </blockquote></div> </div></body></html>