evas: avoid double eet_close call while caching GL shader.
authorCedric BAIL <cedric@osg.samsung.com>
Tue, 24 Nov 2015 22:33:20 +0000 (14:33 -0800)
committerCedric BAIL <cedric@osg.samsung.com>
Tue, 24 Nov 2015 22:33:20 +0000 (14:33 -0800)
src/modules/evas/engines/gl_common/evas_gl_shader.c

index c5ef0b9..3b7986d 100644 (file)
@@ -317,12 +317,15 @@ _evas_gl_common_shader_binary_save(Evas_GL_Shared *shared)
         eet_shutdown();
      }
 
-   if (eet_close(ef) != EET_ERROR_NONE) goto error;
-   if (rename(tmp_file, bin_file_path) < 0) goto error;
+   if (eet_close(ef) != EET_ERROR_NONE) goto destroyed;
+   if (rename(tmp_file, bin_file_path) < 0) goto destroyed;
+
    eet_shutdown();
    return 1;
 
-error:
+ destroyed:
+   ef = NULL;
+ error:
    if (ef) eet_close(ef);
    if (evas_gl_common_file_cache_file_exists(tmp_file)) unlink(tmp_file);
    eet_shutdown();