parent while in INIT_INSTANCE
- From: Kevin Ryde <user42 zip com au>
- To: gtk-perl-list gnome org
- Subject: parent while in INIT_INSTANCE
- Date: Mon, 19 Aug 2013 11:12:24 +1000
With recent debian i386 glib 2.36.3 and gtk 2.24.20 the foo.pl below
dies with
label Gtk2::Label=HASH(0x9fe6cf8)
label now packed
parent MyContainer=HASH(0x9e5d770)
return from INIT_INSTANCE
GLib-GObject-CRITICAL **: g_object_notify_queue_thaw: assertion `g_atomic_int_get(&object->ref_count) > 0'
failed at foo.el line 26.
GLib-GObject-CRITICAL **: g_object_notify_queue_thaw: assertion `g_atomic_int_get(&object->ref_count) > 0'
failed at foo.el line 26.
object 9e61008 is not really a GObject at foo.el line 26.
It seems to be due to taking $label->parent() within INIT_INSTANCE. Or
at least if you don't do that it's ok. Is that supposed to work? It
worked in the past.
#!/usr/bin/perl -w
use strict;
use warnings;
use Gtk2 '-init';
{
package MyContainer;
use Glib::Object::Subclass 'Gtk2::HBox';
sub INIT_INSTANCE {
my ($self) = @_;
my $label = Gtk2::Label->new;
print "label $label\n";
$self->pack_start ($label, 0,0,0);
print "label now packed\n";
my $parent = $label->parent;
print "parent $parent\n";
print "return from INIT_INSTANCE\n";
}
}
my $mycontainer = MyContainer->new;
print "mycontainer is $mycontainer\n";
exit 0;
--
Come to Bob's Camping and Outdoor supplies,
for now is the winter of our discount tents.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]