w.signal_connect('delete-event') { w.destroy }
w.signal_connect('destroy') {
Thread.kill(refresh_thread)
- gtk_thread_abandon #- needed because we're about to destroy widgets in w, for which they may be some pending gtk calls
+ gtk_thread_flush #- needed because we're about to destroy widgets in w, for which they may be some pending gtk calls
if infopipe_path
infopipe.close
system("rm -f #{infopipe_path}")
madewith = madewithentry.text
if src_nb_thread
Thread.kill(src_nb_thread)
- gtk_thread_abandon #- needed because we're about to destroy widgets in dialog, for which they may be some pending gtk calls
+ gtk_thread_flush #- needed because we're about to destroy widgets in dialog, for which they may be some pending gtk calls
end
dialog.destroy
Gtk.timeout_remove(timeout_src_nb)
:successmsg_linkurl => $xmldoc.root.attributes['destination'],
:closure_after => proc {
$xmldoc.elements.each('//dir') { |elem|
+ $modified ||= elem.attributes['already-generated'].nil?
elem.add_attribute('already-generated', 'true')
}
UndoHandler.cleanup #- prevent save_changes to mark current dir as not already generated
$redo_tb.sensitive = $redo_mb.sensitive = false
save_current_file
$generated_outofline = true
- $modified = true
}})
}
$view_wa.signal_connect('activate') {
end
end
-def gtk_thread_abandon
+def gtk_thread_flush
$protect_gtk_pending_calls.try_lock
+ for closure in $gtk_pending_calls
+ closure.call
+ end
$gtk_pending_calls = []
$protect_gtk_pending_calls.unlock
end