From 86a90daf1b9f07912ceeaa3be8e2d8c123cf0172 Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@duempel.org>
Date: Fri, 18 Mar 2016 16:56:33 +0100
Subject: [PATCH] db/update/Remove: pass URI to Remove()

---
 src/db/update/Editor.cxx | 2 +-
 src/db/update/Remove.cxx | 5 ++---
 src/db/update/Remove.hxx | 2 +-
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/db/update/Editor.cxx b/src/db/update/Editor.cxx
index 910747a7e..57d7bb806 100644
--- a/src/db/update/Editor.cxx
+++ b/src/db/update/Editor.cxx
@@ -39,7 +39,7 @@ DatabaseEditor::DeleteSong(Directory &dir, Song *del)
 	const ScopeDatabaseUnlock unlock;
 
 	/* now take it out of the playlist (in the main_task) */
-	remove.Remove(del);
+	remove.Remove(del->GetURI());
 
 	/* finally, all possible references gone, free it */
 	del->Free();
diff --git a/src/db/update/Remove.cxx b/src/db/update/Remove.cxx
index 04232cf6a..499ef921c 100644
--- a/src/db/update/Remove.cxx
+++ b/src/db/update/Remove.cxx
@@ -20,7 +20,6 @@
 #include "config.h" /* must be first for large file support */
 #include "Remove.hxx"
 #include "UpdateDomain.hxx"
-#include "db/plugins/simple/Song.hxx"
 #include "db/DatabaseListener.hxx"
 #include "Log.hxx"
 
@@ -51,14 +50,14 @@ UpdateRemoveService::RunDeferred()
 }
 
 void
-UpdateRemoveService::Remove(const Song *song)
+UpdateRemoveService::Remove(std::string &&uri)
 {
 	bool was_empty;
 
 	{
 		const ScopeLock protect(mutex);
 		was_empty = uris.empty();
-		uris.emplace_front(song->GetURI());
+		uris.emplace_front(std::move(uri));
 	}
 
 	/* inject an event into the main thread, but only if the list
diff --git a/src/db/update/Remove.hxx b/src/db/update/Remove.hxx
index 8b381b5fa..e8e1f137c 100644
--- a/src/db/update/Remove.hxx
+++ b/src/db/update/Remove.hxx
@@ -52,7 +52,7 @@ public:
 	 * This serialized access is implemented to avoid excessive
 	 * locking.
 	 */
-	void Remove(const Song *song);
+	void Remove(std::string &&uri);
 
 private:
 	/* virtual methods from class DeferredMonitor */