TFloatSpinEdit locks app when setting parent
Original Reporter info from Mantis: Bart @flyingsheep
-
Reporter name: Bart Broersma
Original Reporter info from Mantis: Bart @flyingsheep
- Reporter name: Bart Broersma
Description:
When you set the parent property of a TFloatSpinEdit, the application locks up in GTK2 Linux.
As a result you also cannot put a TFloatSpinEdit on a form in the IDE.
In GTK Linux there is no problem.
In previous versions of Lazarus this worked just fine, so it's a regression.
Steps to reproduce:
Create an empty project with just a form.
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormKeyPress(Sender: TObject; var Key: char);
private
{ private declarations }
FloatEdit: TFloatSpinEdit;
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
uses lclproc;
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject);
begin
FloatEdit := TFloatSpinEdit.Create(Self);
end;
procedure TForm1.FormKeyPress(Sender: TObject; var Key: char);
begin
if Upcase(Key) = 'F' then
begin
FloatEdit.Parent := Self;
end;
end;
Compile and run.
Press 'F'
Additional information:
The following order of events occur:
FloatEdit.SetParent
FloatEdit.DisableAutoSizing (direct call in FloatEdit.SetParent)
nd FloatEdit.DisableAutoSizing
Form1.DisableAutoSizing Form1:TForm1 0
End Form1.DisableAutoSizing Form1:TForm1 1
Form1.DisableAutoSizing Form1:TForm1 1
End Form1.DisableAutoSizing Form1:TForm1 2
Form1.EnableAutoSizing Form1:TForm1 2
End Form1.EnableAutoSizing Form1:TForm1 1
FloatEdit.EnableAutoSizing :TFloatSpinEdit 1 (direct call in FloatEdit.SetParent)
Form1.EnableAutoSizing Form1:TForm1 1
FloatEdit.DisableAutoSizing :TFloatSpinEdit 0
Form1.DisableAutoSizing Form1:TForm1 0
End Form1.DisableAutoSizing Form1:TForm1 1
End FloatEdit.DisableAutoSizing :TFloatSpinEdit 1
FloatEdit.DisableAutoSizing :TFloatSpinEdit 1
End FloatEdit.DisableAutoSizing :TFloatSpinEdit 2
FloatEdit.EnableAutoSizing :TFloatSpinEdit 2
End FloatEdit.EnableAutoSizing :TFloatSpinEdit 1
After this the following error occurs and this line is printed endlessly on the console:
(foo:7093): GLib-GObject-CRITICAL **: g_closure_ref: assertion `closure->ref_count < CLOSURE_MAX_REF_COUNT' failed
The form now becomes unresposive and can only be killed.
FWIW:
Linux 2.6.13-15 i686
gtk2-2.8.3-4
fpc 2.4.0
Mantis conversion info:
- Mantis ID: 17816
- OS: Suse Linux
- OS Build: 10.0
- Build: r28055
- Platform: i386
- Version: 0.9.29 (SVN)
- Fixed in version: 0.9.31 (SVN)
- Fixed in revision: 29157 (#619744bf)