Added a little locking, seems to have fixed the segmentation fault
This commit is contained in:
parent
45b374f24f
commit
b9965dc75c
|
@ -1,6 +1,7 @@
|
||||||
# Python module that handles calls to the twitter API as a separate thread
|
# Python module that handles calls to the twitter API as a separate thread
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
import gtk
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
|
||||||
class GetTweets(Thread):
|
class GetTweets(Thread):
|
||||||
|
@ -44,7 +45,11 @@ class GetTweets(Thread):
|
||||||
else:
|
else:
|
||||||
statuses = results_to_statuses(self.api.Search(self.list_name, rpp=self.num_entries))
|
statuses = results_to_statuses(self.api.Search(self.list_name, rpp=self.num_entries))
|
||||||
|
|
||||||
self.pane.update_window(statuses)
|
gtk.gdk.threads_enter()
|
||||||
|
try:
|
||||||
|
self.pane.update_window(statuses)
|
||||||
|
finally:
|
||||||
|
gtk.gdk.threads_leave()
|
||||||
|
|
||||||
print 'debug: GetTweets.run(): finished'
|
print 'debug: GetTweets.run(): finished'
|
||||||
|
|
||||||
|
|
|
@ -446,5 +446,6 @@ parser.add_option('-c' ,'--config', dest="filename", default="~/.mytwitter.conf"
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
my_twitter = MyTwitter(options.filename)
|
my_twitter = MyTwitter(options.filename)
|
||||||
|
|
||||||
gtk.gdk.threads_init()
|
gtk.gdk.threads_init()
|
||||||
gtk.main()
|
gtk.main()
|
||||||
|
|
Reference in New Issue
Block a user