Fix in RenderAttachment destructor 65/42665/2
authorDavid Fumanal <d.fumanal@samsung.com>
Wed, 1 Jul 2015 09:53:09 +0000 (10:53 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Wed, 1 Jul 2015 10:31:02 +0000 (03:31 -0700)
Change-Id: I2bb8be038314b07cd410a3ab28739b35cb843926

dali/internal/update/node-attachments/scene-graph-renderer-attachment.cpp

index 80f3c5b..e022fd4 100644 (file)
@@ -81,11 +81,16 @@ RendererAttachment::RendererAttachment()
 
 RendererAttachment::~RendererAttachment()
 {
-  mMaterial->RemoveConnectionObserver(*this);
-  mGeometry->RemoveConnectionObserver(*this);
-
-  mMaterial=NULL;
-  mGeometry=NULL;
+  if (mMaterial)
+  {
+    mMaterial->RemoveConnectionObserver(*this);
+    mMaterial=NULL;
+  }
+  if (mGeometry)
+  {
+    mGeometry->RemoveConnectionObserver(*this);
+    mGeometry=NULL;
+  }
 }
 
 void RendererAttachment::Initialize2( BufferIndex updateBufferIndex )