summaryrefslogtreecommitdiff
path: root/Userland/Services
diff options
context:
space:
mode:
authorBrian Gianforcaro <bgianf@serenityos.org>2021-09-05 10:31:39 -0700
committerAndreas Kling <kling@serenityos.org>2021-09-05 20:12:09 +0200
commit5905d2e9e9380f6c4d0fc370ba8271371e87e1d3 (patch)
tree51664f3441c7a2a17c9febf53153ab9150d92e78 /Userland/Services
parent293e7ccfc703ceb646b395eeaf164b5c197d6bb2 (diff)
downloadserenity-5905d2e9e9380f6c4d0fc370ba8271371e87e1d3.zip
RequestServer: Exit early to avoid executing protocol destructors
I broke this when I made the protocol objects be wrapped by smart pointers to appease static analysis. The Protocol base class currently VERIFY's that it's never called. So to have the best of both worlds until someone actually fixes the code to do proper de-registration, just call `exit(..)` so the smart pointers never go out of scope.
Diffstat (limited to 'Userland/Services')
-rw-r--r--Userland/Services/RequestServer/Protocol.cpp1
-rw-r--r--Userland/Services/RequestServer/main.cpp7
2 files changed, 7 insertions, 1 deletions
diff --git a/Userland/Services/RequestServer/Protocol.cpp b/Userland/Services/RequestServer/Protocol.cpp
index 19f9fdb1f4..2db08d9685 100644
--- a/Userland/Services/RequestServer/Protocol.cpp
+++ b/Userland/Services/RequestServer/Protocol.cpp
@@ -31,6 +31,7 @@ Protocol::Protocol(const String& name)
Protocol::~Protocol()
{
+ // FIXME: Do proper de-registration.
VERIFY_NOT_REACHED();
}
diff --git a/Userland/Services/RequestServer/main.cpp b/Userland/Services/RequestServer/main.cpp
index e3fea3fb0d..8b3385ea73 100644
--- a/Userland/Services/RequestServer/main.cpp
+++ b/Userland/Services/RequestServer/main.cpp
@@ -46,5 +46,10 @@ int main(int, char**)
auto socket = Core::LocalSocket::take_over_accepted_socket_from_system_server();
VERIFY(socket);
IPC::new_client_connection<RequestServer::ClientConnection>(socket.release_nonnull(), 1);
- return event_loop.exec();
+ auto result = event_loop.exec();
+
+ // FIXME: We exit instead of returning, so that protocol destructors don't get called.
+ // The Protocol base class should probably do proper de-registration instead of
+ // just VERIFY_NOT_REACHED().
+ exit(result);
}