Index: gperl.h =================================================================== RCS file: /cvsroot/gtk2-perl/gtk2-perl-xs/Glib/gperl.h,v retrieving revision 1.51 diff -u -d -p -r1.51 gperl.h --- gperl.h 16 Dec 2007 16:32:13 -0000 1.51 +++ gperl.h 22 Dec 2007 17:46:12 -0000 @@ -250,7 +215,7 @@ typedef GPerlFilename GPerlFilename_ornu #define newSVGObject(obj) (gperl_new_object ((obj), FALSE)) #define newSVGObject_noinc(obj) (gperl_new_object ((obj), TRUE)) -#define SvGObject(sv) (gperl_get_object (sv)) +#define SvGObject(sv) (gperl_get_object_check (sv, G_TYPE_OBJECT)) #define SvGObject_ornull(sv) (gperl_sv_defined (sv) ? SvGObject (sv) : NULL) Index: t/2.t =================================================================== RCS file: /cvsroot/gtk2-perl/gtk2-perl-xs/Glib/t/2.t,v retrieving revision 1.8 diff -u -d -p -r1.8 2.t --- t/2.t 30 May 2005 17:58:25 -0000 1.8 +++ t/2.t 22 Dec 2007 17:46:12 -0000 @@ -1,3 +1,4 @@ +#!/usr/bin/perl # # $Header: /cvsroot/gtk2-perl/gtk2-perl-xs/Glib/t/2.t,v 1.8 2005/05/30 17:58:25 kaffeetisch Exp $ # @@ -8,11 +9,11 @@ use strict; use warnings; # Before `make install' is performed this script should be runnable with -# `make test'. After `make install' it should work as `perl 1.t' +# `make test'. After `make install' it should work as `perl 2.t' ######################### -use Test::More tests => 9; +use Test::More tests => 10; BEGIN { use_ok('Glib'); Glib::Object->set_threadsafe (1); }; ######################### @@ -46,6 +47,13 @@ isa_ok ($obj3, 'Glib::Object'); is ($obj3, $obj2); is ($obj3->{key}, $obj2->{key}); +# regression tests + +# make sure calling a Glib::Object method on something invalid results in an +# error message, not in a segmentation fault +eval { Glib::Object->get (123); }; +like ($@, qr/is not of type Glib::Object/); + __END__