Skip to content

Commit

Permalink
fix bug reported in #695: draw_region runs in a non-UI thread, so it …
Browse files Browse the repository at this point in the history
…is possible for us to call it on a window that is being disposed of - also make a copy of the "self._backing" before dereferencing it

git-svn-id: https://xpra.org/svn/Xpra/trunk@7827 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Sep 29, 2014
1 parent a04c9cc commit ef86249
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/xpra/client/client_window_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,17 @@ def refresh_all_windows(self):

def draw_region(self, x, y, width, height, coding, img_data, rowstride, packet_sequence, options, callbacks):
""" Note: this runs from the draw thread (not UI thread) """
assert self._backing, "window %s has no backing!" % self._id
if not self._backing:
log("draw_region: window %s has no backing, gone?", self._id)
from xpra.client.window_backing_base import fire_paint_callbacks
fire_paint_callbacks(callbacks, False)
return
def after_draw_refresh(success):
plog("after_draw_refresh(%s) %sx%s at %sx%s encoding=%s, options=%s", success, width, height, x, y, coding, options)
if success and self._backing and self._backing.draw_needs_refresh:
if not success:
return
backing = self._backing
if backing and backing.draw_needs_refresh:
self.queue_draw(x, y, width, height)
callbacks.append(after_draw_refresh)
self._backing.draw_region(x, y, width, height, coding, img_data, rowstride, options, callbacks)
Expand Down

0 comments on commit ef86249

Please sign in to comment.