Fix bug in checking return value of create_cb 59/42159/1 accepted/tizen/mobile/20150625.054615 accepted/tizen/tv/20150625.054620 accepted/tizen/wearable/20150625.054632 submit/tizen/20150625.025455
authorJiwoong Im <jiwoong.im@samsung.com>
Wed, 24 Jun 2015 02:41:48 +0000 (11:41 +0900)
committerJiwoong Im <jiwoong.im@samsung.com>
Wed, 24 Jun 2015 02:41:48 +0000 (11:41 +0900)
call terminate_cb when the create_cb returns false

Change-Id: Ib2f455efd01a8dff7debd2cab00c2515a1adbb43
Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
src/appcore-efl.c

index e42606c..f704dcb 100644 (file)
@@ -802,9 +802,11 @@ static int __before_loop(struct ui_priv *ui, int *argc, char ***argv)
        LOG(LOG_DEBUG, "LAUNCH", "[%s:Platform:appcore_init:done]", ui->name);
        if (ui->ops && ui->ops->create) {
                r = ui->ops->create(ui->ops->data);
-               if (r == -1) {
+               if (r < 0) {
                        _ERR("create() return error");
                        appcore_exit();
+                       if (ui->ops && ui->ops->terminate)
+                               ui->ops->terminate(ui->ops->data);
                        errno = ECANCELED;
                        return -1;
                }