Skip to content

Commit 41ed48d

Browse files
committed
Merge pull request kivy#317 from akshayaurora/async_image
fix Async image crash when source is set to ''
2 parents 83169ad + 0519639 commit 41ed48d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

kivy/uix/image.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ def __init__(self, **kwargs):
237237

238238
def on_source(self, instance, value):
239239
if not value:
240+
self._coreimage.unbind(on_texture=self._on_tex_change)
240241
self.texture = None
241242
self._coreimage = None
242243
else:
@@ -258,4 +259,5 @@ def is_uri(self, filename):
258259
return proto in ('http', 'https', 'ftp')
259260

260261
def _on_tex_change(self, *largs):
261-
self.texture = self._coreimage.texture
262+
if self._coreimage:
263+
self.texture = self._coreimage.texture

0 commit comments

Comments
 (0)