Skip to content

Commit

Permalink
fix possible race during cleanup: avoid None client dereference but k…
Browse files Browse the repository at this point in the history
…eep claiming that we have handled the message since we must be exiting already to have cleared the reference to the client instance

git-svn-id: https://xpra.org/svn/Xpra/trunk@8804 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Mar 20, 2015
1 parent 674df02 commit d365422
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/xpra/platform/win32/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,11 +540,14 @@ def handle_console_event(self, event):
log.info("received console event %s", str(event_name).replace("_EVENT", ""))
else:
log.warn("unknown console event: %s", event_name)
c = self.client
if event==win32con.CTRL_C_EVENT:
self.client.signal_disconnect_and_quit(0, "CTRL_C")
if c:
c.signal_disconnect_and_quit(0, "CTRL_C")
return 1
if event==win32con.CTRL_CLOSE_EVENT:
self.client.signal_disconnect_and_quit(0, "CTRL_CLOSE")
if c:
c.signal_disconnect_and_quit(0, "CTRL_CLOSE")
return 1
return 0

Expand Down

0 comments on commit d365422

Please sign in to comment.