Fix memory issue in key grab API 32/174232/1 accepted/tizen/4.0/unified/20180416.071457 submit/tizen_4.0/20180416.011224
authorHeeyong Song <heeyong.song@samsung.com>
Thu, 29 Mar 2018 07:34:04 +0000 (16:34 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Thu, 29 Mar 2018 07:34:08 +0000 (16:34 +0900)
Change-Id: I0c23fce017ff6523e6b55b2c91f5c2c7e0d585fe

adaptors/ecore/wayland/key-grab-ecore-wl.cpp
adaptors/tizen/native-render-surface-tizen.cpp

index 551000c..2ad86f0 100755 (executable)
@@ -101,42 +101,42 @@ bool GrabKeyList( Window window, const Dali::Vector<Dali::KEY>& daliKeyVector, c
   eina_init();
 
   Eina_List* keyList = NULL;
+  Ecore_Wl_Window_Keygrab_Info* info = new Ecore_Wl_Window_Keygrab_Info[keyCount];
   {
     for( Dali::Vector<float>::SizeType index = 0; index < keyCount; ++index )
     {
-      Ecore_Wl_Window_Keygrab_Info info;
-      info.key = const_cast<char*>(Dali::Internal::Adaptor::KeyLookup::GetKeyName( daliKeyVector[index] ));
+      info[index].key = const_cast<char*>(Dali::Internal::Adaptor::KeyLookup::GetKeyName( daliKeyVector[index] ));
 
       switch( grabModeVector[index] )
       {
         case TOPMOST:
         {
-          info.mode = ECORE_WL_WINDOW_KEYGRAB_TOPMOST;
+          info[index].mode = ECORE_WL_WINDOW_KEYGRAB_TOPMOST;
           break;
         }
         case SHARED:
         {
-          info.mode = ECORE_WL_WINDOW_KEYGRAB_SHARED;
+          info[index].mode = ECORE_WL_WINDOW_KEYGRAB_SHARED;
           break;
         }
         case OVERRIDE_EXCLUSIVE:
         {
-          info.mode = ECORE_WL_WINDOW_KEYGRAB_OVERRIDE_EXCLUSIVE;
+          info[index].mode = ECORE_WL_WINDOW_KEYGRAB_OVERRIDE_EXCLUSIVE;
           break;
         }
         case EXCLUSIVE:
         {
-          info.mode = ECORE_WL_WINDOW_KEYGRAB_EXCLUSIVE;
+          info[index].mode = ECORE_WL_WINDOW_KEYGRAB_EXCLUSIVE;
           break;
         }
         default:
         {
-          info.mode = ECORE_WL_WINDOW_KEYGRAB_UNKNOWN;
+          info[index].mode = ECORE_WL_WINDOW_KEYGRAB_UNKNOWN;
           break;
         }
       }
 
-      keyList = eina_list_append( keyList, &info );
+      keyList = eina_list_append( keyList, &info[index] );
     }
   }
 
@@ -170,6 +170,8 @@ bool GrabKeyList( Window window, const Dali::Vector<Dali::KEY>& daliKeyVector, c
     }
   }
 
+  delete [] info;
+
   eina_list_free( keyList );
   eina_list_free( grabList );
   eina_shutdown();
index 0bd6b7a..cc6e288 100644 (file)
@@ -97,6 +97,8 @@ NativeRenderSurface::~NativeRenderSurface()
 
     DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::General, "Own tbm surface queue destroy\n" );
   }
+
+  ecore_wl_shutdown();
 }
 
 void NativeRenderSurface::SetRenderNotification( TriggerEventInterface* renderNotification )