Delete ReloadFlag accepted/tizen/6.0/unified/20201111.064934 submit/tizen_6.0/20201110.110443 submit/tizen_6.0/20201110.230218 submit/tizen_6.0/20201110.230946
authorSunghyun Kim <scholb.kim@samsung.com>
Wed, 4 Nov 2020 06:53:37 +0000 (15:53 +0900)
committerSunghyun Kim <scholb.kim@samsung.com>
Tue, 10 Nov 2020 07:35:23 +0000 (16:35 +0900)
1. ReloadFlag don't need now.
   Sometimes this flag can make a crash.

2. To avoid the crash, WidgetView need to check WatchHandle when it
dispose old buffer.

Change-Id: I22b7582baa5115c4b39d748e0dd39861f05714be

widget_viewer_dali/internal/widget_view/widget_view_impl.cpp
widget_viewer_dali/internal/widget_view/widget_view_impl.h

index 74bf1a62789db38f94ee3b2daeb1ba5119a8cf7d..f1a49a337bd0ad9d4000373458fe830b6a50b2cf 100644 (file)
@@ -259,7 +259,6 @@ static void OnSurfaceRemoved( const char *appid, const char *instance_id, const
   if( widgetView && !widgetView->IsWidgetFaulted() )
   {
     widgetView->CloseRemoteSurface();
-    widgetView->SetReloadFlag( true );
   }
 }
 
@@ -300,7 +299,6 @@ WidgetView::WidgetView()
   mWatcherHandle( NULL ),
   mRemoteSurface( NULL ),
   mBuffer( NULL ),
-  mReloadFlag( false ),
   mCreated( false ),
   mResizeRequired( false ),
   mPaused( false ),
@@ -328,7 +326,6 @@ WidgetView::WidgetView( const std::string& widgetId, const std::string& contentI
   mWatcherHandle( NULL ),
   mRemoteSurface( NULL ),
   mBuffer( NULL ),
-  mReloadFlag( false ),
   mCreated( false ),
   mResizeRequired( false ),
   mPaused( false ),
@@ -699,10 +696,7 @@ void WidgetView::SendWidgetEvent( int event )
     case WIDGET_INSTANCE_EVENT_FAULT:
     {
       mWidgetFaultedSignal.Emit( handle );
-      if( mReloadFlag == false )
-      {
-        CloseRemoteSurface();
-      }
+      CloseRemoteSurface();
       break;
     }
     case WIDGET_INSTANCE_EVENT_CREATE_ABORTED:
@@ -1367,11 +1361,6 @@ void WidgetView::CloseRemoteSurface()
   }
 }
 
-void WidgetView::SetReloadFlag( bool reload)
-{
-  mReloadFlag = reload;
-}
-
 void WidgetView::ShowLoadingState( bool show )
 {
   if( mPreviewImage && mPreviewVisible )
@@ -1706,7 +1695,14 @@ void WidgetView::UpdateBuffer( struct tizen_remote_surface *surface, struct wl_b
 
   if( mBuffer != NULL && tizen_remote_surface_get_version( surface ) >= TIZEN_REMOTE_SURFACE_RELEASE_SINCE_VERSION )
   {
-    screen_connector_toolkit_dispose_buffer( mWatcherHandle , mBuffer );
+    if( mWatcherHandle != NULL )
+    {
+      screen_connector_toolkit_dispose_buffer( mWatcherHandle , mBuffer );
+    }
+    else
+    {
+      DALI_LOG_ERROR("WidgetView can't dispose buffer because mWatcherHandle is invalid. ");
+    }
   }
 
   mRemoteSurface = surface;
@@ -1732,7 +1728,6 @@ void WidgetView::ReloadWidget()
       DALI_LOG_INFO( gWidgetViewLogging, Debug::Verbose, "WidgetView::ActivateFaultedWidget: widget_instance_launch is failed. [%s]\n", mWidgetId.c_str() );
       ActivateFaultedWidget();
     }
-    SetReloadFlag( false );
   }
 }
 
index d206604ac83608224118252203df4dc0317cf606..12c5a433aafb460626fef872dc1fefa0050860af 100644 (file)
@@ -354,7 +354,6 @@ private:
   screen_connector_toolkit_h mWatcherHandle;
   tizen_remote_surface* mRemoteSurface;
   wl_buffer* mBuffer;
-  bool mReloadFlag;
   bool mCreated;
   bool mResizeRequired;
   bool mPaused;