summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-02-20 20:32:11 +0100
committerMax Kellermann <max@musicpd.org>2019-02-20 20:43:31 +0100
commit6c28adbcd2e0e9b78d7d68193f435e80548565fe (patch)
treeee19b60447a91cd04683b1e55507c6a5ec2afcd7 /test
parent2125e3ed5708898f18da21a33ddd7b4d3ea9c41e (diff)
db/Plugin: use std::unique_ptr<> to manage Database pointers
Diffstat (limited to 'test')
-rw-r--r--test/DumpDatabase.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/test/DumpDatabase.cxx b/test/DumpDatabase.cxx
index 4a32f6e45..76315c133 100644
--- a/test/DumpDatabase.cxx
+++ b/test/DumpDatabase.cxx
@@ -133,15 +133,13 @@ try {
if (path != nullptr)
block.AddBlockParam("path", path->value, path->line);
- Database *db = plugin->create(init.GetEventLoop(),
- init.GetEventLoop(),
- database_listener, block);
-
- AtScopeExit(db) { delete db; };
+ auto db = plugin->create(init.GetEventLoop(),
+ init.GetEventLoop(),
+ database_listener, block);
db->Open();
- AtScopeExit(db) { db->Close(); };
+ AtScopeExit(&db) { db->Close(); };
const DatabaseSelection selection("", true);