Segfault in Gtk2::Ex::Simple::List 0.50



In the following code, pushing a 0 instead of a Pixbuf provokes a segfault, but strangely, not in the debugger.

Regards

Jeff

#!/usr/bin/perl
use warnings;
use strict;
use Gtk2 -init;
use Gtk2::Ex::Simple::List;

my $win = Gtk2::Window->new;
$win->signal_connect (delete_event => sub { Gtk2->main_quit; });

my $vbox = Gtk2::VBox->new;
$win->add ($vbox);

my $slist = Gtk2::Ex::Simple::List->new ( 'Int' => 'int', 'Pixbuf' => 'pixbuf' );

$vbox->add ($slist);

my $button = Gtk2::Button->new ( 'Add' );
$vbox->add ($button);
$button -> signal_connect(clicked => sub {
push @{$slist->{data}}, [ 1, 0 ]
});

$win->show_all;
Gtk2->main;

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]