Re: segv on exit from certain uimanager program
- From: Kevin Ryde <user42 zip com au>
- To: gtk-perl-list gnome org
- Subject: Re: segv on exit from certain uimanager program
- Date: Sun, 02 Dec 2007 09:41:51 +1100
muppet <scott asofyet org> writes:
$toplevel->signal_connect (destroy => sub { delete $_[0]{ui} });
That's a typical way to break a reference cycle, which may be the root
of the problem.
It seems strange a circular reference is/may-be actively harmful, as
opposed to just mucking about with the order of destructors, or not
doing them at all.
$toplevel->signal_connect (destroy => sub { Gtk2->main_quit });
sub do_quit { $toplevel->destroy } # a confirmation prompt would
go here
Ah yes. I guess there's a choice whether to destroy inside the main
loop or let it happen (if it does) outside.
This has the added benefit of making your script finish properly when
the user kills the window via the window manager.
I'd hooked onto delete-event myself, not really trusting/knowing the
default for that is a destroy (I know it is for dialogs via a slight
hack, wan't sure about toplevels). I think I still need delete-event if
I play 20 questions with the user about jobs in progress. (Not that
that's related to the segv ...)
Emmanuele Bassi <ebassi gmail com> writes:
sub do_quit { Gtk2->main_quit }
Yep, that's what I've changed to. I don't know why I started with exit
-- probably because I wanted to exit :).
instead. calling "exit" is really not the nicest way to terminate a GTK+
application, in *any* language.
There's so many ways a program can keel over unexpectedly I figure you
can't really count on much in the way of finish-ups (while not disputing
the general virtue I suppose in making an effort).
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]