Ticket #7486 (closed defect: fixed)
Sugar shell crashes when threads used.
| Reported by: | cscott | Owned by: | tomeu |
|---|---|---|---|
| Priority: | high | Milestone: | 8.2.0 (was Update.2) |
| Component: | sugar | Version: | Development build as of this date |
| Keywords: | joyride-2268:+ sugar-0.82.0:+ | Cc: | marco, tomeu, cjb |
| Action Needed: | finalize | Verified: | no |
| Deployments affected: | Blocked By: | ||
| Blocking: |
Description
Sugar never calls gtk.gdk.threads_init(), so any attempt to use threads in code called by the sugar shell (control panel code in particular) causes sugar to crash -- python throws an assertion about its GILlock.
The fix is very simple: in /usr/share/sugar/shell/main.py, right after:
pygtk.require('2.0')
import gtk
import gobject
add the line:
gtk.gdk.threads_init()
Voila! No more crashes.
Found this bug while writing the 'activity update' sugar control panel, which uses threads to keep the UI responsive while it is doing network operations in the background to update activity version status.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.


