aboutsummaryrefslogtreecommitdiffstats
path: root/src/UpdateGlue.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-17 21:13:40 +0200
committerMax Kellermann <max@duempel.org>2013-10-17 21:13:40 +0200
commit7ef40de98bb3cbf2fd1fe693871a30064d7ef41b (patch)
treedf7b0904b1629f64a746053c4d38868d7dfe92b9 /src/UpdateGlue.cxx
parent196ec25682e303e90f3e0b2c93691203c19ec339 (diff)
downloadmpd-7ef40de98bb3cbf2fd1fe693871a30064d7ef41b.tar.gz
mpd-7ef40de98bb3cbf2fd1fe693871a30064d7ef41b.tar.xz
mpd-7ef40de98bb3cbf2fd1fe693871a30064d7ef41b.zip
UpdateQueue: use std::string and std::queue
Diffstat (limited to 'src/UpdateGlue.cxx')
-rw-r--r--src/UpdateGlue.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/UpdateGlue.cxx b/src/UpdateGlue.cxx
index 86b80271f..663b996b5 100644
--- a/src/UpdateGlue.cxx
+++ b/src/UpdateGlue.cxx
@@ -139,8 +139,6 @@ update_enqueue(const char *path, bool _discard)
*/
static void update_finished_event(void)
{
- char *path;
-
assert(progress == UPDATE_PROGRESS_DONE);
update_thread.Join();
@@ -151,11 +149,11 @@ static void update_finished_event(void)
/* send "idle" events */
instance->DatabaseModified();
- path = update_queue_shift(&discard);
- if (path != NULL) {
+ auto i = update_queue_shift();
+ if (i.IsDefined()) {
/* schedule the next path */
- spawn_update_task(path);
- g_free(path);
+ discard = i.discard;
+ spawn_update_task(i.path_utf8.c_str());
} else {
progress = UPDATE_PROGRESS_IDLE;