From: Laszlo T. <ave...@us...> - 2004-04-14 23:54:14
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/ACMImporter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5590/ACMImporter Modified Files: ACMImp.cpp readers.cpp readers.h unpacker.cpp unpacker.h Log Message: another batch of fixed leaks (textarea is still weird) Index: ACMImp.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/ACMImporter/ACMImp.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** ACMImp.cpp 9 Apr 2004 13:38:36 -0000 1.38 --- ACMImp.cpp 14 Apr 2004 23:53:35 -0000 1.39 *************** *** 133,137 **** music.reader->get_samplerate() ); } ! delete( memory ); alSourceQueueBuffers( MusicSource, MUSICBUFERS, MusicBuffers ); if (alIsSource( MusicSource )) { --- 133,137 ---- music.reader->get_samplerate() ); } ! delete[] memory; alSourceQueueBuffers( MusicSource, MUSICBUFERS, MusicBuffers ); if (alIsSource( MusicSource )) { *************** *** 218,222 **** SDL_KillThread( musicThread ); SDL_DestroyMutex( musicMutex ); ! delete( static_memory ); alutExit(); } --- 218,222 ---- SDL_KillThread( musicThread ); SDL_DestroyMutex( musicMutex ); ! delete[] static_memory; alutExit(); } *************** *** 316,324 **** DisplayALError( "[ACMImp::Play] alBufferData : ", error ); alDeleteBuffers( 1, &Buffer ); ! delete( memory ); delete( acm ); return 0; } ! delete( memory ); delete( acm ); --- 316,324 ---- DisplayALError( "[ACMImp::Play] alBufferData : ", error ); alDeleteBuffers( 1, &Buffer ); ! delete[] memory; delete( acm ); return 0; } ! delete[] memory; delete( acm ); Index: unpacker.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/ACMImporter/unpacker.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** unpacker.cpp 24 Feb 2004 22:20:37 -0000 1.4 --- unpacker.cpp 14 Apr 2004 23:53:35 -0000 1.5 *************** *** 105,109 **** int CValueUnpacker::init_unpacker() { ! amp_buffer = new short [0x10000]; if (!amp_buffer) { return 0; --- 105,110 ---- int CValueUnpacker::init_unpacker() { ! //using malloc, supposed to be faster ! amp_buffer =(short *) malloc(sizeof(short)*0x10000); if (!amp_buffer) { return 0; Index: readers.h =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/ACMImporter/readers.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** readers.h 24 Feb 2004 22:20:37 -0000 1.4 --- readers.h 14 Apr 2004 23:53:35 -0000 1.5 *************** *** 148,152 **** { if (block) { ! delete block; } if (unpacker) { --- 148,152 ---- { if (block) { ! free(block); } if (unpacker) { Index: readers.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/ACMImporter/readers.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** readers.cpp 24 Feb 2004 22:20:37 -0000 1.4 --- readers.cpp 14 Apr 2004 23:53:35 -0000 1.5 *************** *** 51,55 **** block_size = ( 1 << levels ) * subblocks; ! block = new long [block_size]; if (!block) { return 0; --- 51,56 ---- block_size = ( 1 << levels ) * subblocks; ! //using malloc for simple arrays (supposed to be faster) ! block = (long *) malloc(sizeof(long)*block_size); if (!block) { return 0; Index: unpacker.h =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/ACMImporter/unpacker.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** unpacker.h 24 Feb 2004 22:20:37 -0000 1.4 --- unpacker.h 14 Apr 2004 23:53:35 -0000 1.5 *************** *** 76,80 **** { if (amp_buffer) { ! delete amp_buffer; } }; --- 76,81 ---- { if (amp_buffer) { ! free(amp_buffer); ! amp_buffer = NULL; } }; |