From 6c28adbcd2e0e9b78d7d68193f435e80548565fe Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 20 Feb 2019 20:32:11 +0100 Subject: db/Plugin: use std::unique_ptr<> to manage Database pointers --- test/DumpDatabase.cxx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'test') 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); -- cgit v1.2.3