[Lazarus] SIGSEGV with Debug only

Daniel Simoes de Ameida dopidaniel at yahoo.com.br
Fri Mar 30 18:14:00 CEST 2012



Martin,

I use a Tab Style interface... (TDI)... so, I change the Owner/Parent in this function:


procedure TFormDJ_Main.ShowFormInPage(const AForm : TForm ;
  const ImageIndex : Integer) ;
var
   APage   : TFormPage ;
begin
  nbForms.Visible    := True ;    { Shows NoteBook }
  FecharAba1.Enabled := True ;    { Habilita Opão no Menu Principal }
{$IFDEF MSWINDOWS}
  btFechaAba.Visible := True ;    { Shows Close Buttom on TopRight }
{$ENDIF}

  //Create a new Page
  APage            := TFormPage.Create(nbForms) ;  // This will call TFormPage.SetAForm
  APage.ImageIndex := ImageIndex;
  APage.AForm      := AForm;

  //activate the Page
  nbForms.ActivePage := APage;
end;



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);

  fsAForm.Visible := True ;
end;

Thanks for your help


[]s Daniel

Conheça o Projeto ACBr - Automaçao Comercial Brasil
DJSystem a Loja Patrocinadora do ACBr



>________________________________
> De: Martin <lazarus at mfriebe.de>
>Para: Daniel Simoes de Ameida <dopidaniel at yahoo.com.br>; Lazarus mailing list <lazarus at lists.lazarus.freepascal.org> 
>Enviadas: Sexta-feira, 30 de Março de 2012 12:55
>Assunto: Re: [Lazarus] SIGSEGV with Debug only
> 
>
>On 30/03/2012 16:11, Daniel Simoes de Ameida wrote: 
>Bingo...
>>
>>Is the HeapTrace.. I just removed HeapTrace Unit from Linking
          and the problem has gone... 
>>
>No it has not gone.
>
>It is only hidden. That means you lowered the likelihood of it
    happening.
>
>The code still accesses an object that does not exist. That means
    random memory.
>Without heaptrc, you simple got better likelihood, that this random
    memory contains data, that does not cause a crash. 
>But the bug is still there. It may still crash...
>
>Since it happens at form close, maybe you freed some component in
    your code?
>Changed owner of a component (moving to other form)?
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20120330/495e4e61/attachment-0003.html>


More information about the Lazarus mailing list