db/Plugin: use std::unique_ptr<> to manage Database pointers
This commit is contained in:
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user