close
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, 4 years ago)

A patch that seems to resolve this issue

  • journal.py

    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 class JournalInteraction(): 
    328328 
    329329    def take_screenshot(self, waveform_id = 1): 
    330330        #file_path = os.path.join(tempfile.gettempdir(), '%i' % time.time()) 
     331        gtk.threads_enter() 
    331332        act_root = environ['SUGAR_ACTIVITY_ROOT']  
    332333        tmp_dir = join(act_root, 'data') 
    333334        tmp_fd, file_path = tempfile.mkstemp(dir=tmp_dir) 
    class JournalInteraction(): 
    367368        finally: 
    368369            os.close(tmp_fd) 
    369370            os.remove(file_path) 
     371            gtk.threads_leave() 
    370372 
    371373""" 
    372374#FOR TESTING JOURNALINTERACTION CLASS