Fixed memory corruption in RendererAttachment::DoPrepareRender() 11/45111/2
authorPaul Wisbey <p.wisbey@samsung.com>
Fri, 31 Jul 2015 15:18:02 +0000 (16:18 +0100)
committerPaul Wisbey <p.wisbey@samsung.com>
Fri, 31 Jul 2015 15:20:58 +0000 (16:20 +0100)
(Fixes crash issue in blocks.example)

Change-Id: I18a3f3690ddc0204a1b69c0687aabae4fc627dad

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

index abbe7e1..eac06ef 100644 (file)
@@ -399,16 +399,17 @@ void RendererAttachment::DoPrepareRender( BufferIndex updateBufferIndex )
 
   if( mResendGeometry )
   {
+    // The first call to GetRenderGeometry() creates the geometry and sends it in a message
+    RenderGeometry* geometry = mGeometry->GetRenderGeometry( mSceneController );
+
     typedef MessageValue1< NewRenderer, RenderGeometry* > DerivedType;
     unsigned int* slot = mSceneController->GetRenderQueue().ReserveMessageSlot( updateBufferIndex, sizeof( DerivedType ) );
 
-    new (slot) DerivedType( mRenderer, &NewRenderer::SetGeometry,mGeometry->GetRenderGeometry(mSceneController) );
+    new (slot) DerivedType( mRenderer, &NewRenderer::SetGeometry, geometry );
     mResendGeometry = false;
-
   }
 }
 
-
 void RendererAttachment::ConnectionsChanged( PropertyOwner& object )
 {
   // One of our child objects has changed it's connections. Ensure the uniform