Commits

Scott Lawrence  committed 2e33590 Merge

merge changes for sh-1591

  • Participants
  • Parent commits 7402543, d13de87

Comments (0)

Files changed (2)

File indra/llmessage/lldatapacker.h

 
 				S32			getCurrentSize() const	{ return (S32)(mCurBufferp - mBufferp); }
 				S32			getBufferSize() const	{ return mBufferSize; }
+				const U8*   getBuffer() const   { return mBufferp; }    
 				void		reset()				{ mCurBufferp = mBufferp; mWriteEnabled = (mCurBufferp != NULL); }
 				void		freeBuffer()		{ delete [] mBufferp; mBufferp = mCurBufferp = NULL; mBufferSize = 0; mWriteEnabled = FALSE; }
 				void		assignBuffer(U8 *bufferp, S32 size)
 				{
+					if(mBufferp && mBufferp != bufferp)
+					{
+						freeBuffer() ;
+					}
 					mBufferp = bufferp;
 					mCurBufferp = bufferp;
 					mBufferSize = size;

File indra/newview/llvocache.cpp

 	S32 size = -1;
 	BOOL success;
 
+	mDP.assignBuffer(mBuffer, 0);
 	success = check_read(apr_file, &mLocalID, sizeof(U32));
 	if(success)
 	{
 
 LLVOCacheEntry::~LLVOCacheEntry()
 {
-	if(mBuffer)
+	if(mBuffer != mDP.getBuffer())
 	{
-		delete[] mBuffer;
+		delete[] mBuffer ; //just in case
 	}
+	mDP.freeBuffer();
 }