ilmCommon: fix destruction order of "components"
authorMarcus Fritzsch <marcus.fritzsch@xse.de>
Tue, 22 Jul 2014 09:00:09 +0000 (11:00 +0200)
committerNobuhiko Tanibata <NOBUHIKO_TANIBATA@denso.co.jp>
Tue, 12 Aug 2014 13:15:14 +0000 (22:15 +0900)
After display ownership is managed in ilmCommon, it is important
to destroy components in the reverse order they were created.

Signed-off-by: Marcus Fritzsch <marcus.fritzsch@xse.de>
ivi-layermanagement-api/ilmCommon/src/ilm_common.c

index 45897b3..442dde7 100644 (file)
@@ -69,8 +69,8 @@ ilm_initWithNativedisplay(t_ilm_nativedisplay nativedisplay)
     err = ilmControl_init(display);
     if (ILM_SUCCESS != err)
     {
-        gIlmCommonPlatformFunc.destroy();
         ilmClient_destroy();
+        gIlmCommonPlatformFunc.destroy();
         return err;
     }
 
@@ -86,8 +86,8 @@ ilm_isInitialized(void)
 ILM_EXPORT ilmErrorTypes
 ilm_destroy(void)
 {
-    ilmErrorTypes retVal = gIlmCommonPlatformFunc.destroy();
-    ilmClient_destroy();
     ilmControl_destroy(); // block until control thread is stopped
+    ilmClient_destroy();
+    ilmErrorTypes retVal = gIlmCommonPlatformFunc.destroy();
     return retVal;
 }