From 0519639d3348c7c13ef4be0ff81f7821c6c1a10b Mon Sep 17 00:00:00 2001 From: akshayaurora Date: Sun, 20 Nov 2011 01:51:25 +0530 Subject: [PATCH] fix Async image crash when source is set to '' while loader.gif is animating --- kivy/uix/image.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kivy/uix/image.py b/kivy/uix/image.py index e83761ce3..ce8531aac 100644 --- a/kivy/uix/image.py +++ b/kivy/uix/image.py @@ -237,6 +237,7 @@ class AsyncImage(Image): def on_source(self, instance, value): if not value: + self._coreimage.unbind(on_texture=self._on_tex_change) self.texture = None self._coreimage = None else: @@ -258,4 +259,5 @@ class AsyncImage(Image): return proto in ('http', 'https', 'ftp') def _on_tex_change(self, *largs): - self.texture = self._coreimage.texture + if self._coreimage: + self.texture = self._coreimage.texture