[FIX] application termination by manager request for common app type 08/20908/1
authorVitaliy Cherepanov <v.cherepanov@samsung.com>
Tue, 13 May 2014 17:55:24 +0000 (21:55 +0400)
committerVitaliy Cherepanov <v.cherepanov@samsung.com>
Tue, 13 May 2014 17:55:24 +0000 (21:55 +0400)
add app_efl_main function call flag.
if app_efl_main was not called then terminate app by exit(0) call

Change-Id: Ia2397144b334005fcce12fce707f39583be22c86
Signed-off-by: Vitaliy Cherepanov <v.cherepanov@samsung.com>
helper/appfw-capi.c
helper/appfw-tizen.cpp
helper/dahelper.c
include/dahelper.h
probe_capi/capi_appfw.c

index 03d2929..6dfbc4f 100644 (file)
  */
 
 #include <app.h>
+#include "dahelper.h"
 
 void application_exit()
 {
+       PRINTMSG("EXIT appfw-capi");
        app_efl_exit();
 }
 
index 46405bf..306c3d4 100644 (file)
@@ -30,6 +30,7 @@
 
 #include <app.h>
 #include <FApp.h>
+#include "dahelper.h"
 using namespace Tizen::App;
 
 #define UNKNOWN_USER_EVENT     5873
@@ -43,6 +44,7 @@ void application_exit()
        App* self = App::GetInstance();
        if(self != NULL)
        {
+               PRINTMSG("EXIT self");
                self->Terminate();
                // send unknown user event to main thread
                // because this cause that main thread execute terminating routine without block
@@ -50,7 +52,15 @@ void application_exit()
        }
        else
        {
+               PRINTMSG("EXIT self - efl_exit >");
                app_efl_exit();
+               if (app_efl_main_flg == 0) {
+                       PRINTMSG("no app_efl_main detected, terminate by exit(0)");
+                       //sleep for flush message to manager
+                       sleep(1);
+                       exit(0);
+               }
+               PRINTMSG("EXIT self - efl_exit <");
        }
 }
 
index ab5a75e..20a1f10 100755 (executable)
@@ -35,6 +35,8 @@
 #include <assert.h>
 #include "dahelper.h"
 
+int app_efl_main_flg = 0;
+
 const char *lib_string[NUM_ORIGINAL_LIBRARY] = {
        "libc.so.6",                            //0
        "libpthread.so.0",                      //1
index 721a403..1947845 100755 (executable)
@@ -42,6 +42,8 @@
 extern "C"{
 #endif
 
+extern int app_efl_main_flg;
+
 #define MAX_PATH_LENGTH                256
 #define MAX_STACK_DEPTH                128
 #define TRIM_STACK_DEPTH       2
index 8e7a644..97d3cc6 100644 (file)
@@ -140,6 +140,9 @@ int app_efl_main(int *argc, char ***argv, app_event_callback_s *callback, void *
        Ecore_Event_Handler* handler;
        int ret;
 
+       //set app_efl flag to determinate termination way for app
+       app_efl_main_flg = 1;
+
        GET_REAL_FUNC(app_efl_main, LIBCAPI_APPFW_APPLICATION);
 
        probeBlockStart();