mirror of https://github.com/kivy/kivy.git
fix Async image crash when source is set to ''
while loader.gif is animating
This commit is contained in:
parent
40483bdfd7
commit
0519639d33
|
@ -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):
|
||||
if self._coreimage:
|
||||
self.texture = self._coreimage.texture
|
||||
|
|
Loading…
Reference in New Issue