Aleric is right. This makes no sense. Don't bring this from v2, cuz it's wrong.

This commit is contained in:
Shyotl
2011-07-12 15:35:35 -05:00
parent f93bcae65b
commit 4f8f24921f

View File

@@ -179,10 +179,12 @@ public:
void freeBuffer() { delete [] mBufferp; mBufferp = mCurBufferp = NULL; mBufferSize = 0; mWriteEnabled = FALSE; }
void assignBuffer(U8 *bufferp, S32 size)
{
if(mBufferp && mBufferp != bufferp)
//No no no no no! This breaks the paradigm of callers handling buffer allocation/deallocation
//Also, buffers can be on stack! Calling delete[] on such a buffer would be VERY bad.
/*if(mBufferp && mBufferp != bufferp)
{
freeBuffer() ;
}
}*/
mBufferp = bufferp;
mCurBufferp = bufferp;
mBufferSize = size;