Skip to content

Commit

Permalink
Merge pull request #28 from quite/fix-memory-leak
Browse files Browse the repository at this point in the history
Solving memory leak, issue #27, courtesy @hrkfdn
  • Loading branch information
hrkfdn committed Dec 3, 2015
2 parents 6a314c3 + bc1cbf2 commit 10a4b0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mpd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ CMPD::Update()
int newsongid = mpd_status_get_song_id(status);
int newsongpos = mpd_status_get_elapsed_time(status);
int curplaytime = mpd_stats_get_play_time(stats);
mpd_song *song = mpd_run_current_song(_conn);

// new song
if(newsongid != _songid) {
_songid = newsongid;
_songpos = newsongpos;
_start = curplaytime;

mpd_song *song = mpd_run_current_song(_conn);
if(song) {
GotNewSong(song);
mpd_song_free(song);
Expand Down

0 comments on commit 10a4b0f

Please sign in to comment.