[problem] AnimatableMesh get deleted before MeshActor
[solution] Keep a reference to the AnimatableMesh so it would not be destroyed before the MeshActor object
Change-Id: Ib56bd23ddd630e4fb25f65310bd639f76a656fa3
Signed-off-by: Adeel Kazmi <adeel.kazmi@samsung.com>
void MeshActor::SetMesh(Dali::AnimatableMesh mesh)
{
+ mAnimatableMeshHandle = mesh;
SetMesh( GetImplementation(mesh).GetMesh() );
SetInitialVolume(Vector3(1.0f, 1.0f, 1.0f));
#include <cstddef>
// INTERNAL INCLUDES
-#include <dali/public-api/object/ref-object.h>
+#include <dali/public-api/object/handle.h>
#include <dali/public-api/actors/mesh-actor.h>
#include <dali/public-api/geometry/mesh.h>
#include <dali/public-api/modeling/entity.h>
private:
Internal::MeshAttachmentPtr mMeshAttachment;
+ // To keep a reference to the AnimatableMesh so it would not be destroyed before the MeshActor object
+ Dali::Handle mAnimatableMeshHandle;
};
} // namespace Internal