db/update/Remove: pass URI to Remove()
This commit is contained in:
parent
42f7df9681
commit
86a90daf1b
@ -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();
|
||||
|
@ -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
|
||||
|
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user