summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Lima (Etrunko) <eduardo.lima@intel.com>2013-09-17 15:36:08 -0300
committerEduardo Lima (Etrunko) <eduardo.lima@intel.com>2013-09-19 19:45:26 -0300
commit0645bdf03cf77a7ada3ce50eb2f6fd7d5031d964 (patch)
tree7163e97a502310d1d64179708de8f90686363957
parent46543660eb478de9b20becdd6f7de09748538b36 (diff)
downloadweekeyboard-0645bdf03cf77a7ada3ce50eb2f6fd7d5031d964.tar.gz
weekeyboard-0645bdf03cf77a7ada3ce50eb2f6fd7d5031d964.tar.bz2
weekeyboard-0645bdf03cf77a7ada3ce50eb2f6fd7d5031d964.zip
Added wkb_ibus_config_unregister
Used to free a reference of the config_eet object, which is initialized in the register function so it can be used by our IBusConfig interface implementation. Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com>
-rw-r--r--src/wkb-ibus-config.c28
-rw-r--r--src/wkb-ibus.c1
-rw-r--r--src/wkb-ibus.h1
3 files changed, 29 insertions, 1 deletions
diff --git a/src/wkb-ibus-config.c b/src/wkb-ibus-config.c
index 7c698fe..0c6e3bc 100644
--- a/src/wkb-ibus-config.c
+++ b/src/wkb-ibus-config.c
@@ -21,6 +21,9 @@
#include <Eldbus.h>
#include "wkb-ibus.h"
+#include "wkb-ibus-config-eet.h"
+
+static struct wkb_ibus_config_eet *_conf_eet = NULL;
#define CONFIG_CHECK_MESSAGE_ERRORS(_msg) \
do \
@@ -165,6 +168,29 @@ static const Eldbus_Service_Interface_Desc _wkb_ibus_config_interface =
Eldbus_Service_Interface *
wkb_ibus_config_register(Eldbus_Connection *conn)
{
- return eldbus_service_interface_register(conn, IBUS_PATH_CONFIG, &_wkb_ibus_config_interface);
+ Eldbus_Service_Interface *ret = eldbus_service_interface_register(conn, IBUS_PATH_CONFIG, &_wkb_ibus_config_interface);
+
+ if (!ret)
+ {
+ ERR("Unable to register IBusConfig interface\n");
+ goto end;
+ }
+
+ if (_conf_eet)
+ {
+ WRN("wkb_config_eet already created\n");
+ goto end;
+ }
+
+ _conf_eet = wkb_ibus_config_eet_new("");
+
+end:
+ return ret;
}
+static void
+wkb_ibus_config_unregister(void)
+{
+ if (_conf_eet)
+ wkb_ibus_config_eet_free(_conf_eet);
+}
diff --git a/src/wkb-ibus.c b/src/wkb-ibus.c
index 60cdac2..ee52c69 100644
--- a/src/wkb-ibus.c
+++ b/src/wkb-ibus.c
@@ -489,6 +489,7 @@ wkb_ibus_disconnect(void)
#if 0
if (ctx->config.interface)
{
+ wkb_ibus_config_unregister();
eldbus_name_release(ctx->conn, IBUS_SERVICE_CONFIG, _wkb_name_release_cb, ctx);
eldbus_signal_handler_del(ctx->config.name_acquired);
eldbus_signal_handler_del(ctx->config.name_lost);
diff --git a/src/wkb-ibus.h b/src/wkb-ibus.h
index f3b0a1f..1b92b99 100644
--- a/src/wkb-ibus.h
+++ b/src/wkb-ibus.h
@@ -60,6 +60,7 @@ Eldbus_Service_Interface * wkb_ibus_panel_register(Eldbus_Connection *conn);
/* Config */
#if 0
Eldbus_Service_Interface * wkb_ibus_config_register(Eldbus_Connection *conn);
+void wkb_ibus_config_unregister(void);
#endif
#ifdef __cplusplus