segv on mistaken bless
- From: Kevin Ryde <user42 zip com au>
- To: gtk-perl-list gnome org
- Subject: segv on mistaken bless
- Date: Sat, 31 May 2008 09:53:24 +1000
I made a mistake in a GObject subclass creation by just blessing into
the class instead of Glib::Object->new and got a segv from signal_emit,
per below.
It'd be nice if the code noticed that, but I couldn't tell if it'd be
the signal_emit xsub or gperl_get_object_check which might check for a
missing mg_find. Do some uses of gperl_get_object_check expect to get
back NULL for undef?
package Foo;
use strict;
use warnings;
use Glib;
use Glib::Object::Subclass
Glib::Object::,
signals => { message => { param_types => ['Glib::String'],
return_type => undef },
};
sub start {
my ($class, %self) = @_;
my $self = bless \%self, $class;
}
package main;
use strict;
use warnings;
my $foo = Foo->start ();
$foo->signal_emit ('message', 'hello world');
exit 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]