[Rigo] avoid race with finally block and GC wrt file descriptors

It has been observed that subprocess.call() called by open_url()
might fail due to Error 9 (Bad File Descriptor) due to a race
between the garbage collector thread (run in the MainThread) and
our own subprocess.call() thread. For this reason, make sure to
call open_url() outside the try/finally block. This seems to be
enough.
This commit is contained in:
Fabio Erculiani
2012-07-14 18:22:48 +02:00
parent afd2608153
commit f573957172

View File

@@ -561,7 +561,6 @@ class LicensesNotificationBox(NotificationBox):
tmp_f.write("-" * 79 + "\n")
tmp_f.write(license_text)
tmp_f.flush()
open_url(tmp_path)
else:
const_debug_write(
__name__,
@@ -576,6 +575,9 @@ class LicensesNotificationBox(NotificationBox):
pass
# leaks, but xdg-open is async
if tmp_path is not None:
open_url(tmp_path)
def _on_license_activate(self, widget, uri):
"""
License link clicked.