[player] Call Gdk.threads_init() before import Gtk
authorPhilip Chimento <philip.chimento@gmail.com>
Fri, 28 Sep 2012 13:59:29 +0000 (15:59 +0200)
committerPhilip Chimento <philip.chimento@gmail.com>
Fri, 28 Sep 2012 14:01:58 +0000 (16:01 +0200)
I thought this might fix the crashing problems with the Python
player, since you should initialize Gdk threads before initializing
Gtk, and Gtk is initialized on import from gi.repository.

It didn't fix the problems, but it's a good thing to do anyway.

player/player.py

index c153c688545f34c98c259ac40d0e4a5359417440..ce0bdc1ed8a50276f49eebb77752ff78f8d6c5f9 100644 (file)
@@ -3,6 +3,8 @@
 import sys
 import os.path
 import argparse
+from gi.repository import Gdk
+Gdk.threads_init()
 from gi.repository import GObject, GLib, Gdk, Gio, Gtk, Chimara
 import config
 
@@ -334,8 +336,6 @@ if __name__ == '__main__':
         metavar='GRAPHICS FILE', help='a Blorb resource file to include')
     args = parser.parse_args()
 
-    Gdk.threads_init()
-
     # Create configuration dir ~/.chimara
     try:
         os.mkdir(os.path.expanduser('~/.chimara'))