storage/Plugin: return std::unique_ptr<Storage>

This commit is contained in:
Max Kellermann
2018-01-02 16:11:17 +01:00
parent 3f4f7b0a53
commit 3c5e4e2788
15 changed files with 46 additions and 32 deletions

View File

@@ -199,13 +199,13 @@ handle_mount(Client &client, Request args, Response &r)
}
auto &event_loop = instance.io_thread.GetEventLoop();
Storage *storage = CreateStorageURI(event_loop, remote_uri);
auto storage = CreateStorageURI(event_loop, remote_uri);
if (storage == nullptr) {
r.Error(ACK_ERROR_ARG, "Unrecognized storage URI");
return CommandResult::ERROR;
}
composite.Mount(local_uri, storage);
composite.Mount(local_uri, storage.release());
instance.EmitIdle(IDLE_MOUNT);
#ifdef ENABLE_DATABASE