From: Mike Blumenkrantz Date: Wed, 29 May 2019 13:23:23 +0000 (-0400) Subject: ecore-x: protect ecore_x_shutdown from creating a negative init count X-Git-Tag: accepted/tizen/unified/20190604.014647~72 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=55ffe97e60da8e7c9a0535d6947a89a1c7f15a25;p=platform%2Fupstream%2Fefl.git 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 --- diff --git a/src/lib/ecore_x/ecore_x.c b/src/lib/ecore_x/ecore_x.c index f3d8cae..500ef19 100644 --- a/src/lib/ecore_x/ecore_x.c +++ b/src/lib/ecore_x/ecore_x.c @@ -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;