Fixed some serialization issues related to swapping endianness of DNA, and fixed memory leak in btSerializer

This commit is contained in:
erwin.coumans
2010-02-13 01:33:28 +00:00
parent 1a87fbf2f0
commit 32b4de20ab
3 changed files with 60 additions and 14 deletions

View File

@@ -125,6 +125,9 @@ class btDefaultSerializer : public btSerializer
int m_totalSize;
unsigned char* m_buffer;
int m_currentSize;
void* m_dna;
int m_dnaLength;
btAlignedObjectArray<btChunk*> m_chunkPtrs;
@@ -333,9 +336,7 @@ protected:
public:
void* m_dna;
int m_dnaLength;
btDefaultSerializer(int totalSize)
:m_totalSize(totalSize),
@@ -378,7 +379,10 @@ public:
virtual ~btDefaultSerializer()
{
btAlignedFree(m_buffer);
if (m_buffer)
btAlignedFree(m_buffer);
if (m_dna)
btAlignedFree(m_dna);
}
virtual void startSerialization()