add null check for mSurface at ReplaseSurface 92/187992/2
authorJoogab Yun <joogab.yun@samsung.com>
Thu, 30 Aug 2018 07:06:42 +0000 (16:06 +0900)
committerjoogab yun <joogab.yun@samsung.com>
Thu, 30 Aug 2018 08:36:39 +0000 (08:36 +0000)
crash occurs :
(gdb) bt full
#0  0xb7fbb868 in ?? ()
No symbol table info available.
#1  0xb6ded69c in Dali::Internal::Adaptor::RenderHelper::ReplaceSurface (this=this@entry=0xb7fd2384, newSurface=0xb7fcd990) at ../../../dali/internal/graphics/common/render-helper.cpp:112
No locals.
#2  0xb6de877c in Dali::Internal::Adaptor::CombinedUpdateRenderController::UpdateRenderThread (this=0xb7fd2368) at ../../../dali/internal/adaptor/common/combined-update-render-controller.cpp:439
(gdb) f 1
#1  0xb6ded69c in Dali::Internal::Adaptor::RenderHelper::ReplaceSurface (this=this@entry=0xb7fd2384, newSurface=0xb7fcd990) at ../../../dali/internal/graphics/common/render-helper.cpp:112
112 ../../../dali/internal/graphics/common/render-helper.cpp: No such file or directory.
(gdb) p mSurface
$1 = (Dali::RenderSurface *) 0x0

Change-Id: I23a11c968d7133e95208cbd7e9341541e3466541

dali/internal/graphics/common/render-helper.cpp

index 87cdb3b..95155c0 100644 (file)
@@ -109,7 +109,10 @@ void RenderHelper::InitializeEgl()
 
 void RenderHelper::ReplaceSurface( RenderSurface* newSurface )
 {
-  mSurface->DestroyEglSurface(*mEGL);
+  if( mSurface )
+  {
+    mSurface->DestroyEglSurface(*mEGL);
+  }
 
   // This is designed for replacing pixmap surfaces, but should work for window as well
   // we need to delete the egl surface and renderable (pixmap / window)