From e5df85db158c440048af7d9f34681562cefbf7d2 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 14 Aug 2006 23:31:08 +0000 Subject: Several bugfixes during exit found by valgrind First, make sure we call finishPlaylist() before closeMp3Directory() since the latter will free non-SONG_TYPE_URL songs in playlist, which causes an invalid read when we try to look for SONG_TYPE_URL songs to free in finishPlaylist. Secondly, make sure our children have all exited before freeing the playerData. If we do not, slowly-delivered signals can trigger a race condition in the signal handlers of the decode and player processes which rely on getPlayerData. To avoid waitpid-ing too long (or at all), move the freePlayerData() call farther down in main() (this won't affect anything else) to give the OS a better chance to deliver signals and finish running sig handlers for terminated children. git-svn-id: https://svn.musicpd.org/mpd/trunk@4640 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/player.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/player.c') diff --git a/src/player.c b/src/player.c index 527e28aff..c24424c44 100644 --- a/src/player.c +++ b/src/player.c @@ -124,8 +124,8 @@ int playerInit(void) closeAllListenSockets(); freeAllInterfaces(); - closeMp3Directory(); finishPlaylist(); + closeMp3Directory(); finishPermissions(); finishCommands(); finishVolume(); -- cgit v1.2.3