summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Lima (Etrunko) <eduardo.lima@intel.com>2013-10-03 11:42:31 -0300
committerEduardo Lima (Etrunko) <eduardo.lima@intel.com>2013-10-03 11:42:31 -0300
commitcec0f5d37dc37920e931b9bfad2d23caa4f5425f (patch)
treed78d6e70a431438a800cb1bbe5f88059468b3aae
parentf3f5e2a420d98eedc27fe7070a65d5cac6e58205 (diff)
downloadweekeyboard-cec0f5d37dc37920e931b9bfad2d23caa4f5425f.tar.gz
weekeyboard-cec0f5d37dc37920e931b9bfad2d23caa4f5425f.tar.bz2
weekeyboard-cec0f5d37dc37920e931b9bfad2d23caa4f5425f.zip
Fix init/shutdown process in wkb-ibus and wkb-ibus-test
Change-Id: Ib67336e6e6ea613ff9aa36590afc54edfb86431b Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com>
-rw-r--r--src/wkb-ibus-test.c13
-rw-r--r--src/wkb-ibus.c33
2 files changed, 27 insertions, 19 deletions
diff --git a/src/wkb-ibus-test.c b/src/wkb-ibus-test.c
index 76661c7..ec7d7a3 100644
--- a/src/wkb-ibus-test.c
+++ b/src/wkb-ibus-test.c
@@ -21,7 +21,6 @@
#include <signal.h>
#include <Eina.h>
-#include <Eet.h>
#include <Ecore.h>
#include <Eldbus.h>
#include <Efreet.h>
@@ -53,12 +52,6 @@ main (int argc, char *argv[])
goto ecore_err;
}
- if (!efreet_init())
- {
- ERR("Error initializing efreet");
- goto efreet_err;
- }
-
if (!wkb_ibus_init())
{
ERR("Error initializing ibus");
@@ -74,15 +67,9 @@ main (int argc, char *argv[])
ret = 0;
end:
- efreet_shutdown();
-
-efreet_err:
ecore_shutdown();
ecore_err:
- eet_shutdown();
-
-eet_err:
wkb_log_shutdown();
return ret;
diff --git a/src/wkb-ibus.c b/src/wkb-ibus.c
index a32c835..b2b299b 100644
--- a/src/wkb-ibus.c
+++ b/src/wkb-ibus.c
@@ -21,6 +21,7 @@
#include <Ecore.h>
#include <Eldbus.h>
+#include <Efreet.h>
#include "wkb-ibus.h"
#include "wkb-ibus-defs.h"
@@ -330,27 +331,43 @@ wkb_ibus_init(void)
if (!eldbus_init())
{
ERR("Error initializing Eldbus");
- return 0;
+ goto eldbus_err;
+ }
+
+ if (!efreet_init())
+ {
+ ERR("Error initializing Efreet");
+ goto efreet_err;
}
if (!wkb_ibus_config_eet_init())
{
- ERR("Error initializing wkb_config_eetn");
- eldbus_shutdown();
- return -0;
+ ERR("Error initializing wkb_config_eet");
+ goto eet_err;
}
if (!ctx && !(ctx = calloc(1, sizeof(*ctx))))
{
ERR("Error calloc");
- eldbus_shutdown();
- return 0;
+ goto calloc_err;
}
_wkb_ibus_query_address();
end:
return ++ctx->refcount;
+
+calloc_err:
+ wkb_ibus_config_eet_shutdown();
+
+eet_err:
+ efreet_shutdown();
+
+efreet_err:
+ eldbus_shutdown();
+
+eldbus_err:
+ return 0;
}
void
@@ -389,6 +406,10 @@ end:
ecore_main_loop_quit();
DBG("Main loop quit");
+
+ wkb_ibus_config_eet_shutdown();
+ efreet_shutdown();
+ eldbus_shutdown();
}
void