From 9cefa3a9da7d9dc5a734f6d271c40927476fbf27 Mon Sep 17 00:00:00 2001 From: yangxiao Date: Thu, 9 Apr 2015 10:52:05 +0800 Subject: [PATCH] weak ref to vertexdata --- cocos/3d/CCMeshVertexIndexData.cpp | 2 -- cocos/3d/CCMeshVertexIndexData.h | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/cocos/3d/CCMeshVertexIndexData.cpp b/cocos/3d/CCMeshVertexIndexData.cpp index 6cd420b8d5..af4dc3eb11 100644 --- a/cocos/3d/CCMeshVertexIndexData.cpp +++ b/cocos/3d/CCMeshVertexIndexData.cpp @@ -56,7 +56,6 @@ MeshIndexData* MeshIndexData::create(const std::string& id, MeshVertexData* vert meshindex->_indexBuffer = indexbuffer; meshindex->_vertexData = vertexData; indexbuffer->retain(); - vertexData->retain(); meshindex->_aabb = aabb; meshindex->autorelease(); @@ -78,7 +77,6 @@ MeshIndexData::MeshIndexData() MeshIndexData::~MeshIndexData() { CC_SAFE_RELEASE(_indexBuffer); - CC_SAFE_RELEASE(_vertexData); } MeshVertexData* MeshVertexData::create(const MeshData& meshdata) diff --git a/cocos/3d/CCMeshVertexIndexData.h b/cocos/3d/CCMeshVertexIndexData.h index 0f2659a012..322a1c4299 100644 --- a/cocos/3d/CCMeshVertexIndexData.h +++ b/cocos/3d/CCMeshVertexIndexData.h @@ -86,7 +86,7 @@ CC_CONSTRUCTOR_ACCESS: protected: IndexBuffer* _indexBuffer; //index buffer - MeshVertexData* _vertexData; //vertex buffer + MeshVertexData* _vertexData; //vertex buffer, wreak ref AABB _aabb; // original aabb of the submesh std::string _id; //id GLenum _primitiveType;