[Vala] Gtk.Dialog.show crashes app



I don't know if this is a vala bug or I have missed something.
In the following code I'm creating a Gtk.Dialog and keeping it
handy to be shown non-modal using show(). The trouble is, after
the dialog is closed, reopening it will crash the application
with "Segmentation fault" no less.

Replacing show() with run() & hide() fixes the problem, but
the dialog is now modal (even after dialog.set_modal).

Please, please tell me I miss something.

------
  Gtk.Dialog dialog = null

  public void show_dialog (Gtk.Window parent) {
    if (dialog == null) {
      dialog = new Gtk.Dialog ();
      dialog.title = "Whatever";
      dialog.delete_event.connect (() => {dialog.hide_on_delete ();});
      dialog.transient_for = parent;
      dialog.set_destroy_with_parent (true);
      dialog.vbox.set_size_request (200, 300);
      dialog.show_all ();
    }
    dialog.show (); // this will crash when invoked after closing
  }
-----

hand
Nor Jaidi Tuah




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