ecore-x: protect ecore_x_shutdown from creating a negative init count

Summary:
@fix
Depends on D8972

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8973
This commit is contained in:
Mike Blumenkrantz 2019-05-29 09:23:23 -04:00
parent 2cf3dc7a39
commit f1b29fbbe7
1 changed files with 5 additions and 0 deletions

View File

@ -889,6 +889,11 @@ _ecore_x_shutdown2(void)
EAPI int
ecore_x_shutdown(void)
{
if (!_ecore_x_init_count)
{
CRI("Calling ecore_x_shutdown without init! BUG!");
return 0;
}
if (--_ecore_x_init_count != 0)
return _ecore_x_init_count;
if (_ecore_x_shutdown()) return _ecore_x_init_count;