forked from enlightenment/efl
evas_gl_core: fix memory leak of EVGL_Resource
If eng_data is NULL and rsc is not NULL in _internal_resources_destroy, then the allocated EVGL_Resource rsc is not free. To resolve this memory leak, eng_data and rsc are checked separately.
This commit is contained in:
parent
87bcc82976
commit
52df41b217
|
@ -88,7 +88,13 @@ error:
|
|||
static void
|
||||
_internal_resources_destroy(void *eng_data, EVGL_Resource *rsc)
|
||||
{
|
||||
if ((!eng_data) || (!rsc)) return;
|
||||
if (!rsc) return;
|
||||
|
||||
if (!eng_data)
|
||||
{
|
||||
free(rsc);
|
||||
return;
|
||||
}
|
||||
|
||||
if (rsc->context)
|
||||
evgl_engine->funcs->context_destroy(eng_data, rsc->context);
|
||||
|
|
Loading…
Reference in New Issue