RequestServer: Use smart pointers for allocating protocols

This commit is contained in:
Brian Gianforcaro 2021-08-31 01:19:20 -07:00 committed by Andreas Kling
parent 71f345bbb8
commit 271d6f494f

View file

@ -4,6 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/OwnPtr.h>
#include <LibCore/EventLoop.h>
#include <LibCore/LocalServer.h>
#include <LibIPC/ClientConnection.h>
@ -38,9 +39,9 @@ int main(int, char**)
return 1;
}
[[maybe_unused]] auto gemini = new RequestServer::GeminiProtocol;
[[maybe_unused]] auto http = new RequestServer::HttpProtocol;
[[maybe_unused]] auto https = new RequestServer::HttpsProtocol;
[[maybe_unused]] auto gemini = make<RequestServer::GeminiProtocol>();
[[maybe_unused]] auto http = make<RequestServer::HttpProtocol>();
[[maybe_unused]] auto https = make<RequestServer::HttpsProtocol>();
auto socket = Core::LocalSocket::take_over_accepted_socket_from_system_server();
VERIFY(socket);