Attachments you submit will be routed for moderation. If you have an account, please
log in first.
Ticket #1904: 0001-Call-gtk.threads_-enter-leave-before-after-taking-th.patch
|
File 0001-Call-gtk.threads_-enter-leave-before-after-taking-th.patch, 1.1 KB
(added by lmacken, 3 years ago)
|
|
A patch that seems to resolve this issue
|
-
From d78b4c9c2724aff6320d20f83abd37750d31a7c9 Mon Sep 17 00:00:00 2001
From: Luke Macken <lmacken@redhat.com>
Date: Thu, 17 Jun 2010 10:28:48 -0400
Subject: [PATCH] Call gtk.threads_{enter,leave} before & after taking the screenshot.
This fixes ticket #1904, which seems to be a race-condition that I am
able to reliably reproduce on the XO-1.5 but not on the 1.0.
http://bugs.sugarlabs.org/ticket/1904
diff --git a/journal.py b/journal.py
index 7ef47f2..3668aaa 100644
|
a
|
b
|
|
| 328 | 328 | |
| 329 | 329 | def take_screenshot(self, waveform_id = 1): |
| 330 | 330 | #file_path = os.path.join(tempfile.gettempdir(), '%i' % time.time()) |
| | 331 | gtk.threads_enter() |
| 331 | 332 | act_root = environ['SUGAR_ACTIVITY_ROOT'] |
| 332 | 333 | tmp_dir = join(act_root, 'data') |
| 333 | 334 | tmp_fd, file_path = tempfile.mkstemp(dir=tmp_dir) |
| … |
… |
|
| 367 | 368 | finally: |
| 368 | 369 | os.close(tmp_fd) |
| 369 | 370 | os.remove(file_path) |
| | 371 | gtk.threads_leave() |
| 370 | 372 | |
| 371 | 373 | """ |
| 372 | 374 | #FOR TESTING JOURNALINTERACTION CLASS |
Download in other formats: