* pressing Esc or WM close button did not cancel import thread
* proper Abort does not wait for import thread either
It was possible to launch a 2nd (and Nth) import thread, all sharing
the Editor's ImportStatus data-structure, all having the same
registered thread-name and same thread-pool name. Plenty of room for
crashes.
gtk_main_iteration ();
}
- import_status.done = true;
+ // wait for thread to terminate
+ while (!import_status.done) {
+ gtk_main_iteration ();
+ }
int result = -1;
Glib::signal_timeout().connect (sigc::mem_fun (*this, &InterthreadProgressWindow::update), 100);
}
+void
+InterthreadProgressWindow::on_hide ()
+{
+ if (!_interthread_info->done) {
+ _interthread_info->cancel = true;
+ }
+}
+
void
InterthreadProgressWindow::cancel_clicked ()
{
protected:
virtual bool update ();
+ virtual void on_hide ();
Gtk::Button _cancel_button;
Gtk::Label _cancel_label;