Skip to content

Commit

Permalink
#669: prevent cleanup races
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@8978 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Apr 9, 2015
1 parent d30a67a commit 2e384af
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/xpra/sound/sound_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,22 +119,27 @@ def stop(self):
# log(v)
self.state = "stopped"
p.set_state(gst.STATE_NULL)
self.volume = None
log("SoundPipeline.stop() done")

def cleanup(self):
self.stop()
if not self.bus:
return
log("SoundPipeline.cleanup()")
self.bus.remove_signal_watch()
if self.bus_message_handler_id:
self.bus.disconnect(self.bus_message_handler_id)
self.stop()
b = self.bus
self.bus = None
log("SoundPipeline.cleanup() bus=%s", b)
if not b:
return
b.remove_signal_watch()
bmhid = self.bus_message_handler_id
log("SoundPipeline.cleanup() bus_message_handler_id=%s", bmhid)
if bmhid:
self.bus_message_handler_id = None
b.disconnect(bmhid)
self.pipeline = None
self.codec = None
self.bitrate = -1
self.state = None
self.volume = None
log("SoundPipeline.cleanup() done")

def on_message(self, bus, message):
Expand Down

0 comments on commit 2e384af

Please sign in to comment.