From 04d02df83248ec8b90451bc5b857f8aee56fd377 Mon Sep 17 00:00:00 2001 From: raster Date: Tue, 20 Dec 2011 05:57:57 +0000 Subject: [PATCH] probably a leak fix in ecor-eglib support - doesnt cause any issues in my testing, but documentation for g_static_mutex's isnt that great to let us know what to do with a static mutex... considering it's... static... pending respons from reporter for backport git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@66360 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- ChangeLog | 4 ++++ src/lib/ecore/ecore_glib.c | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 14a8850..d907eed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -421,3 +421,7 @@ 2011-12-16 Mike Blumenkrantz * Fix possible 0 byte allocation in ecore-x + +2011-12-20 Carsten Haitzler (The Rasterman) + + * Fix probable leak for g_static_mutex's on some architectures diff --git a/src/lib/ecore/ecore_glib.c b/src/lib/ecore/ecore_glib.c index 59673b9..7cea1c9 100644 --- a/src/lib/ecore/ecore_glib.c +++ b/src/lib/ecore/ecore_glib.c @@ -190,7 +190,9 @@ _ecore_glib_select(int ecore_fds, int ret; if (g_main_context_acquire(ctx)) - g_mutex_lock(mutex); + { + if (mutex) g_mutex_lock(mutex); + } else { if (!_ecore_glib_cond) @@ -203,8 +205,9 @@ _ecore_glib_select(int ecore_fds, ret = _ecore_glib_select__locked (ctx, ecore_fds, rfds, wfds, efds, ecore_timeout); - g_mutex_unlock(mutex); + if (mutex) g_mutex_unlock(mutex); g_main_context_release(ctx); + g_static_mutex_free(&lock); return ret; } -- 2.7.4