From 3b8532f3fb379c7ecc6b64eecbbf9c824d18e875 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 15 Aug 2012 23:28:19 +0200 Subject: DatabasePlugin: add method ReturnSong() Allow the plugin to allocate the GetSong() return value. --- src/db/SimpleDatabasePlugin.hxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/db/SimpleDatabasePlugin.hxx') diff --git a/src/db/SimpleDatabasePlugin.hxx b/src/db/SimpleDatabasePlugin.hxx index 7e3f5d2d..2ea5c492 100644 --- a/src/db/SimpleDatabasePlugin.hxx +++ b/src/db/SimpleDatabasePlugin.hxx @@ -38,6 +38,10 @@ class SimpleDatabase : public Database { time_t mtime; +#ifndef NDEBUG + unsigned borrowed_song_count; +#endif + public: gcc_pure struct directory *GetRoot() { @@ -61,6 +65,8 @@ public: 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, -- cgit v1.2.3