diff options
-rw-r--r-- | src/wkb-ibus-config-eet-test.c | 10 | ||||
-rw-r--r-- | src/wkb-ibus-test.c | 27 |
2 files changed, 30 insertions, 7 deletions
diff --git a/src/wkb-ibus-config-eet-test.c b/src/wkb-ibus-config-eet-test.c index a4f0ced..5c014f1 100644 --- a/src/wkb-ibus-config-eet-test.c +++ b/src/wkb-ibus-config-eet-test.c @@ -13,12 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -#include "wkb-ibus-config-eet.h" +#include <stdio.h> #include <Eina.h> #include <Eet.h> +#include "wkb-ibus-config-eet.h" + int main (int argc, char *argv[]) { @@ -33,13 +34,16 @@ main (int argc, char *argv[]) if (!eet_init()) { printf("Error initializing eet"); - return 1; + goto eet_err; } cfg = wkb_ibus_config_eet_new("ibus-cfg.eet"); wkb_ibus_config_eet_free(cfg); +end: eet_shutdown(); + +eet_err: eina_shutdown(); return 0; diff --git a/src/wkb-ibus-test.c b/src/wkb-ibus-test.c index ced4700..e9bcf03 100644 --- a/src/wkb-ibus-test.c +++ b/src/wkb-ibus-test.c @@ -19,6 +19,8 @@ #define _GNU_SOURCE #include <signal.h> +#include <Eina.h> +#include <Eet.h> #include <Ecore.h> #include <Eldbus.h> @@ -38,22 +40,32 @@ _connect_timer(void *data) int main (int argc, char *argv[]) { + int ret = 0; + if (!eet_init()) + { + printf("Error initializing eet"); + return 1; + } + if (!ecore_init()) { printf("Error initializing ecore"); - return 1; + ret = 1; + goto ecore_err; } if (!eldbus_init()) { printf("Error initializing eldbus"); - return 1; + ret = 1; + goto eldbus_err; } if (!wkb_ibus_init()) { printf("Error initializing ibus"); - return 1; + ret = 1; + goto end; } ecore_timer_add(1, _connect_timer, NULL); @@ -63,7 +75,14 @@ main (int argc, char *argv[]) ecore_main_loop_begin(); +end: eldbus_shutdown(); + +eldbus_err: ecore_shutdown(); - return 0; + +ecore_err: + eet_shutdown(); + + return ret; } |