Skip to content

Commit

Permalink
Do not attempt to detach websocket handler if it was not attached.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjoes committed Nov 27, 2011
1 parent 249a33c commit 028b4e1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tornadio2/persistent.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ def _connection_check(self):

def _detach(self):
if self.session is not None:
self.session.stop_heartbeat()
self.session.remove_handler(self)
if self._is_active:
self.session.stop_heartbeat()
self.session.remove_handler(self)

self.session = None

Expand Down

0 comments on commit 028b4e1

Please sign in to comment.