aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/ecore/src/lib/ecore/ecore.c
diff options
context:
space:
mode:
authortsauerbeck <tsauerbeck>2004-02-03 19:49:46 +0000
committertsauerbeck <tsauerbeck@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>2004-02-03 19:49:46 +0000
commit60a47ef2a8004d35c43424050eb647a2a29ff4b7 (patch)
tree20cfd59f232c5a594354d11fe58a2e1feff86cc1 /legacy/ecore/src/lib/ecore/ecore.c
parentoops --disable stuff wouldnt work! :) (diff)
downloadefl-60a47ef2a8004d35c43424050eb647a2a29ff4b7.tar.gz
add ecore refcounting, so ewl doesn't break apps that have their own ecore main loop
SVN revision: 8781
Diffstat (limited to 'legacy/ecore/src/lib/ecore/ecore.c')
-rw-r--r--legacy/ecore/src/lib/ecore/ecore.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/legacy/ecore/src/lib/ecore/ecore.c b/legacy/ecore/src/lib/ecore/ecore.c
index 0bf5421a27..d625a73d5f 100644
--- a/legacy/ecore/src/lib/ecore/ecore.c
+++ b/legacy/ecore/src/lib/ecore/ecore.c
@@ -2,6 +2,7 @@
#include "Ecore.h"
static const char *_ecore_magic_string_get(Ecore_Magic m);
+static int _ecore_init_count = 0;
/**
* Set up connections, signal handlers, sockets etc.
@@ -29,8 +30,10 @@ static const char *_ecore_magic_string_get(Ecore_Magic m);
int
ecore_init(void)
{
- _ecore_signal_init();
- return 1;
+ if (++_ecore_init_count == 1)
+ _ecore_signal_init();
+
+ return _ecore_init_count;
}
/**
@@ -44,9 +47,12 @@ ecore_init(void)
* loop, as the main loop will then fall over and not function properly.
* <hr><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
*/
-void
+int
ecore_shutdown(void)
{
+ if (--_ecore_init_count)
+ return _ecore_init_count;
+
_ecore_exe_shutdown();
_ecore_idle_enterer_shutdown();
_ecore_idler_shutdown();
@@ -54,6 +60,8 @@ ecore_shutdown(void)
_ecore_event_shutdown();
_ecore_main_shutdown();
_ecore_signal_shutdown();
+
+ return _ecore_init_count;
}
void