Mercurial > audlegacy
comparison src/audacious/playback.c @ 4109:2d6fd3f630f0
Adds playback_free() function to fix memory leak in playback_stop(). (Bugzilla #42)
author | Jussi Judin <jjudin+audacious@iki.fi> |
---|---|
date | Tue, 25 Dec 2007 00:53:33 -0600 |
parents | 05e6d9db003c |
children | 2d4b4f13d10d |
comparison
equal
deleted
inserted
replaced
4108:dfe5d686749e | 4109:2d6fd3f630f0 |
---|---|
309 } | 309 } |
310 | 310 |
311 free_vis_data(); | 311 free_vis_data(); |
312 ip_data.paused = FALSE; | 312 ip_data.paused = FALSE; |
313 | 313 |
314 if (playback->pb_ready_mutex) | 314 playback_free(playback); |
315 g_mutex_free(playback->pb_ready_mutex); | |
316 if (playback->pb_ready_cond) | |
317 g_cond_free(playback->pb_ready_cond); | |
318 | |
319 g_free(playback->filename); | |
320 g_slice_free(InputPlayback, playback); | |
321 set_current_input_playback(NULL); | 315 set_current_input_playback(NULL); |
322 #ifdef USE_DBUS | 316 #ifdef USE_DBUS |
323 mpris_emit_status_change(mpris, MPRIS_STATUS_STOP); | 317 mpris_emit_status_change(mpris, MPRIS_STATUS_STOP); |
324 #endif | 318 #endif |
325 } | 319 } |
392 playback->set_params = playback_set_pb_params; | 386 playback->set_params = playback_set_pb_params; |
393 playback->set_title = playback_set_pb_title; | 387 playback->set_title = playback_set_pb_title; |
394 playback->pass_audio = output_pass_audio; | 388 playback->pass_audio = output_pass_audio; |
395 | 389 |
396 return playback; | 390 return playback; |
391 } | |
392 | |
393 /** | |
394 * Destroys InputPlayback. | |
395 * | |
396 * Playback comes from playback_new() function but there can be also | |
397 * other sources for allocated playback data (like filename and title) | |
398 * and this tries to deallocate all that data. | |
399 */ | |
400 void playback_free(InputPlayback *playback) | |
401 { | |
402 g_free(playback->filename); | |
403 g_free(playback->title); | |
404 | |
405 g_mutex_free(playback->pb_ready_mutex); | |
406 g_cond_free(playback->pb_ready_cond); | |
407 | |
408 g_mutex_free(playback->pb_change_mutex); | |
409 g_cond_free(playback->pb_change_cond); | |
410 | |
411 g_slice_free(InputPlayback, playback); | |
397 } | 412 } |
398 | 413 |
399 void | 414 void |
400 playback_run(InputPlayback *playback) | 415 playback_run(InputPlayback *playback) |
401 { | 416 { |