diff options
author | Max Kellermann <max@duempel.org> | 2012-08-15 23:28:19 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2012-08-16 00:04:14 +0200 |
commit | 3b8532f3fb379c7ecc6b64eecbbf9c824d18e875 (patch) | |
tree | 3313a43df3f120b74166749fdd75b07fa89846ba /src/db/ProxyDatabasePlugin.cxx | |
parent | f45616e5f6f7d6aa0fb5ca90a0599eacddf1166b (diff) | |
download | mpd-3b8532f3fb379c7ecc6b64eecbbf9c824d18e875.tar.gz mpd-3b8532f3fb379c7ecc6b64eecbbf9c824d18e875.tar.xz mpd-3b8532f3fb379c7ecc6b64eecbbf9c824d18e875.zip |
DatabasePlugin: add method ReturnSong()
Allow the plugin to allocate the GetSong() return value.
Diffstat (limited to 'src/db/ProxyDatabasePlugin.cxx')
-rw-r--r-- | src/db/ProxyDatabasePlugin.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/db/ProxyDatabasePlugin.cxx b/src/db/ProxyDatabasePlugin.cxx index 26e7b4b84..e27ca8291 100644 --- a/src/db/ProxyDatabasePlugin.cxx +++ b/src/db/ProxyDatabasePlugin.cxx @@ -56,6 +56,8 @@ public: virtual void Close() override; virtual struct song *GetSong(const char *uri_utf8, GError **error_r) const override; + virtual void ReturnSong(struct song *song) const; + virtual bool Visit(const DatabaseSelection &selection, VisitDirectory visit_directory, VisitSong visit_song, @@ -191,6 +193,16 @@ ProxyDatabase::GetSong(const char *uri, GError **error_r) const return nullptr; } +void +ProxyDatabase::ReturnSong(struct song *song) const +{ + assert(song != nullptr); + assert(song_in_database(song)); + assert(song_is_detached(song)); + + song_free(song); +} + static bool Visit(struct mpd_connection *connection, const char *uri, bool recursive, VisitDirectory visit_directory, VisitSong visit_song, |