evas engine: return as soon as possible if the surface or context is not valid.

And later, the surface and context are accessed.
So both of arguments should be valid necessarily.
This commit is contained in:
Hermet Park 2016-09-21 12:24:49 +09:00
parent 10293e6520
commit 2f158ebe65
1 changed files with 3 additions and 7 deletions

View File

@ -3655,18 +3655,14 @@ eng_gl_make_current(void *data EINA_UNUSED, void *surface, void *context)
_tls_check();
if ((!sfc) ^ (!ctx))
if ((!sfc) || (!ctx))
{
ERR("Evas GL on SW engine does not support surfaceless contexts.");
return 0;
}
// Unset surface/context
if ((!sfc) && (!ctx))
{
// Unset surface/context
eina_tls_set(gl_current_ctx_key, NULL);
eina_tls_set(gl_current_sfc_key, NULL);
return 1;
return 0;
}
// Initialize Context if it hasn't been.