Skip to content

Commit 2727af8

Browse files
JohnCoconutminggo
authored andcommitted
refactor CCBundle3DData (#19756)
* remove superfluous constructor and non-virtual destructor destructor should be trivial if it doesn't manage resource. A vector member clears itself automatically. No need to call `clear` in destructor.
1 parent 39199b1 commit 2727af8

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

cocos/3d/CCBundle3DData.h

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,8 @@ struct ModelData
6464
std::vector<std::string> bones;
6565
std::vector<Mat4> invBindPose;
6666

67-
virtual ~ModelData()
68-
{
69-
resetData();
70-
}
67+
virtual ~ModelData() {}
68+
7169
virtual void resetData()
7270
{
7371
bones.clear();
@@ -188,10 +186,6 @@ struct MeshData
188186
, attribCount(0)
189187
{
190188
}
191-
~MeshData()
192-
{
193-
resetData();
194-
}
195189
};
196190

197191
/** mesh datas
@@ -326,7 +320,7 @@ struct NTextureData
326320
Usage type;
327321
GLenum wrapS;
328322
GLenum wrapT;
329-
} ;
323+
};
330324
struct NMaterialData
331325
{
332326
std::vector<NTextureData> textures;
@@ -440,14 +434,9 @@ struct Animation3DData
440434
*/
441435
struct Reference
442436
{
443-
public:
444437
std::string id;
445438
unsigned int type;
446439
unsigned int offset;
447-
448-
Reference(){}
449-
450-
~Reference(){}
451440
};
452441

453442
NS_CC_END

0 commit comments

Comments
 (0)