Added a little locking, seems to have fixed the segmentation fault

This commit is contained in:
Anna 2010-04-22 15:13:49 -04:00
parent 45b374f24f
commit b9965dc75c
2 changed files with 7 additions and 1 deletions

View File

@ -1,6 +1,7 @@
# Python module that handles calls to the twitter API as a separate thread
import re
import gtk
from threading import Thread
class GetTweets(Thread):
@ -44,7 +45,11 @@ class GetTweets(Thread):
else:
statuses = results_to_statuses(self.api.Search(self.list_name, rpp=self.num_entries))
gtk.gdk.threads_enter()
try:
self.pane.update_window(statuses)
finally:
gtk.gdk.threads_leave()
print 'debug: GetTweets.run(): finished'

View File

@ -446,5 +446,6 @@ parser.add_option('-c' ,'--config', dest="filename", default="~/.mytwitter.conf"
(options, args) = parser.parse_args()
my_twitter = MyTwitter(options.filename)
gtk.gdk.threads_init()
gtk.main()