diff --git a/src/playlist/plugins/SoundCloudPlaylistPlugin.cxx b/src/playlist/plugins/SoundCloudPlaylistPlugin.cxx index ae5d72c77..663cee1ef 100644 --- a/src/playlist/plugins/SoundCloudPlaylistPlugin.cxx +++ b/src/playlist/plugins/SoundCloudPlaylistPlugin.cxx @@ -242,7 +242,7 @@ soundcloud_parse_json(const char *url, yajl_handle hand, return -1; } - mutex.lock(); + const ScopeLock protect(mutex); yajl_status stat; int done = 0; @@ -259,7 +259,6 @@ soundcloud_parse_json(const char *url, yajl_handle hand, if (input_stream->IsEOF()) { done = true; } else { - mutex.unlock(); return -1; } } @@ -277,8 +276,6 @@ soundcloud_parse_json(const char *url, yajl_handle hand, } } - mutex.unlock(); - return 0; }