Instance: use std::unique_ptr<> to manage the Database pointer

This commit is contained in:
Max Kellermann
2019-02-20 20:48:20 +01:00
parent 6c28adbcd2
commit 8b5c33cecd
8 changed files with 13 additions and 14 deletions

View File

@@ -41,7 +41,7 @@ class NeighborGlue;
#ifdef ENABLE_DATABASE
#include "db/DatabaseListener.hxx"
class Database;
#include "db/Ptr.hxx"
class Storage;
class UpdateService;
#endif
@@ -104,7 +104,7 @@ struct Instance final
#endif
#ifdef ENABLE_DATABASE
Database *database;
DatabasePtr database;
/**
* This is really a #CompositeStorage. To avoid heavy include
@@ -155,7 +155,7 @@ struct Instance final
* music_directory was configured).
*/
Database *GetDatabase() {
return database;
return database.get();
}
/**