evas gl: Make sure a deleted image can't be the target

If we delete the image that was the target surface for gl
rendering, a crash would occur on the next render cycle.
Unlikely but not impossible to trigger from app side.

@fix
This commit is contained in:
Jean-Philippe Andre 2017-03-30 10:26:24 +09:00
parent 06a7beec52
commit e7eb97f3b0
1 changed files with 3 additions and 0 deletions

View File

@ -769,6 +769,9 @@ evas_gl_common_image_free(Evas_GL_Image *im)
im->references--;
if (im->references > 0) return;
if (im->gc && (im->gc->pipe[0].shader.surface == im))
evas_gl_common_context_target_surface_set(im->gc, im->gc->def_surface);
if (im->fglyph)
{
im->gc->font_glyph_images = eina_list_remove(im->gc->font_glyph_images, im);