ecore_drm: Making _ecore_drm_init_count not to go below zero in _ecore_drm_shutdown.

Summary:
If _ecore_drm_init_count goes below zero, then when next time ecore_drm_init is called, it won't do the initializations which it is supposed to do. So preventing this scenario by not making it go
below zero in _ecore_wl_shutdown function.

@fix

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1573
This commit is contained in:
Srivardhan Hebbar 2014-10-23 09:04:29 -04:00 committed by Chris Michael
parent 005cdf359d
commit 7b1f4c09b9
1 changed files with 3 additions and 0 deletions

View File

@ -102,6 +102,9 @@ log_err:
EAPI int
ecore_drm_shutdown(void)
{
/* _ecore_drm_init_count should not go below zero. */
if (_ecore_drm_init_count < 1) return 0;
/* if we are still in use, decrement init count and get out */
if (--_ecore_drm_init_count != 0) return _ecore_drm_init_count;