comparison music2/music.cc @ 7:fa8511a21d05

Fixes somes memory leaks
author thib
date Tue, 05 Aug 2008 10:06:04 +0000
parents c4af1e9ab8d1
children 4d7486cb20a9
comparison
equal deleted inserted replaced
6:2c890434e30f 7:fa8511a21d05
218 218
219 char* stream_dup = new char[len]; 219 char* stream_dup = new char[len];
220 memcpy(stream_dup, stream, len); 220 memcpy(stream_dup, stream, len);
221 memset(stream, 0, len); 221 memset(stream, 0, len);
222 SDL_MixAudio(stream, (Uint8*)stream_dup, len, cur_vol); 222 SDL_MixAudio(stream, (Uint8*)stream_dup, len, cur_vol);
223 delete[] stream_dup;
223 224
224 return; 225 return;
225 } 226 }
226 void bgm_fadeout(int time) { 227 void bgm_fadeout(int time) {
227 fadecount = 0; 228 fadecount = 0;
288 Mix_FreeChunk(play_chunk[chn]); 289 Mix_FreeChunk(play_chunk[chn]);
289 play_chunk[chn] = 0; 290 play_chunk[chn] = 0;
290 } 291 }
291 292
292 if (playing_koedata) { 293 if (playing_koedata) {
293 delete[] playing_koedata; 294 free(playing_koedata);
294 playing_koedata = 0; 295 playing_koedata = 0;
295 } 296 }
296 297
297 koeinfo = OpenKoeFile(path); 298 koeinfo = OpenKoeFile(path);
298 299