From 7ef40de98bb3cbf2fd1fe693871a30064d7ef41b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 17 Oct 2013 21:13:40 +0200 Subject: UpdateQueue: use std::string and std::queue --- src/UpdateGlue.cxx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/UpdateGlue.cxx') 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; -- cgit v1.2.3