Revert "[Tizen] Fix engine destory problem when WebView.Dispose method is called...
authorSeungho Baek <sbsh.baek@samsung.com>
Wed, 25 Sep 2024 10:10:08 +0000 (19:10 +0900)
committerSeungho Baek <sbsh.baek@samsung.com>
Wed, 25 Sep 2024 10:10:08 +0000 (19:10 +0900)
This reverts commit 10bd1773b5652c104aa23dbbc5e38e18c2aaaf08.

dali-extension/web-engine-lwe/tizen-web-engine-lwe.cpp
dali-extension/web-engine-lwe/tizen-web-engine-lwe.h

index a4ab689..f8768c0 100755 (executable)
@@ -332,7 +332,6 @@ TizenWebEngineLWE::TizenWebEngineLWE()
   mIsMouseLbuttonDown(false),
   mCanGoBack(false),
   mCanGoForward(false),
-  mInDestroyingLWEInstance(false),
   mWebContainer(NULL),
   mDaliImageSrc(NativeImageSource::New(0, 0, NativeImageSource::COLOR_DEPTH_DEFAULT)),
   mNativeDisplay(NULL),
@@ -356,7 +355,6 @@ TizenWebEngineLWE::TizenWebEngineLWE()
 
 TizenWebEngineLWE::~TizenWebEngineLWE()
 {
-  Destroy();
 }
 
 static std::string Langset()
@@ -542,10 +540,6 @@ void TizenWebEngineLWE::Create(uint32_t width, uint32_t height, const std::strin
 
 void TizenWebEngineLWE::TryRendering()
 {
-  if (mInDestroyingLWEInstance) {
-    return;
-  }
-
   if (mTbmQueue)
   {
     if ((size_t)tbm_surface_queue_get_width(mTbmQueue) != mWebContainer->Width() ||
@@ -583,10 +577,6 @@ void TizenWebEngineLWE::TryRendering()
 
 void TizenWebEngineLWE::TryUpdateImage(bool needsSync)
 {
-  if (mInDestroyingLWEInstance) {
-    return;
-  }
-
   mInImageUpdateState = true;
   if (!eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface, mEglContext))
   {
@@ -667,7 +657,14 @@ void TizenWebEngineLWE::PrepareLWERendering()
 void TizenWebEngineLWE::Destroy()
 {
   DestroyRenderingContext();
+
+  if(!mWebContainer)
+  {
+    return;
+  }
+
   DestroyInstance();
+  mWebContainer = NULL;
 }
 
 void TizenWebEngineLWE::InitRenderingContext()
@@ -1123,14 +1120,8 @@ Dali::WebEngineBackForwardList& TizenWebEngineLWE::GetBackForwardList() const
 
 void TizenWebEngineLWE::DestroyInstance()
 {
-  if(!mWebContainer)
-  {
-    return;
-  }
-  mInDestroyingLWEInstance = true;
+  DALI_ASSERT_ALWAYS(mWebContainer);
   mWebContainer->Destroy();
-  mInDestroyingLWEInstance = false;
-  mWebContainer = NULL;
 }
 
 Dali::NativeImageSourcePtr TizenWebEngineLWE::GetNativeImageSource()
index db8a780..7f8542a 100755 (executable)
@@ -620,7 +620,6 @@ private:
   bool               mIsMouseLbuttonDown;
   bool               mCanGoBack;
   bool               mCanGoForward;
-  bool               mInDestroyingLWEInstance;
 
   std::function<void(LWE::WebContainer*, LWE::ResourceError)> mOnReceivedError;
   std::function<void(LWE::WebContainer*, const std::string&)> mOnPageFinishedHandler;