Segmentation fault with Gtk2::MozEmbed

The following script crash after the third click of the button, ie:
after creating, destroying and recreating a window with a Gtk2::MozEmbed

the segmentation fault happens on a mandrake 10.2, a 2006.0 and a Source
Mage install, so it's not specific to my setup.

BTW, on my system I need to have
for Gtk2::MozEmbed to work, and I haven't found a way to make it work at
runtime if this path was not in the library search path at when the
script started. (I tried using $ENV{LD_LIBRARY_PATH} and
@DynaLoader::dl_library_path), any ideas ?


use strict;
use warnings;
use Gtk2 "-init";
use Gtk2::MozEmbed;
my $window;

my $w2=Gtk2::Window->new;
my $button=Gtk2::Button->new('Show/Hide');
$button->signal_connect(clicked => \&click);

sub click
{       if ($window) {$window->destroy;$window=undef;return}
        $window->{embed}=my $embed = Gtk2::MozEmbed -> new();
        my $vbox=Gtk2::VBox->new;
        my $hbox = Gtk2::HBox->new;
        my $back=Gtk2::ToolButton->new_from_stock('gtk-go-back');
        my $forward=Gtk2::ToolButton->new_from_stock('gtk-go-forward');
        $hbox->pack_start($_,0,0,4) for $back,$forward;
        $back->signal_connect(clicked => sub { $embed->go_back });
        $forward->signal_connect(clicked => sub { $embed->go_forward });


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