summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibIPC/IClientConnection.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/Libraries/LibIPC/IClientConnection.h b/Libraries/LibIPC/IClientConnection.h
index 89570fd6ae..e20219cbbb 100644
--- a/Libraries/LibIPC/IClientConnection.h
+++ b/Libraries/LibIPC/IClientConnection.h
@@ -98,6 +98,11 @@ public:
void post_message(const IMessage& message)
{
+ // NOTE: If this connection is being shut down, but has not yet been destroyed,
+ // the socket will be closed. Don't try to send more messages.
+ if (!m_socket->is_open())
+ return;
+
auto buffer = message.encode();
int nwritten = write(m_socket->fd(), buffer.data(), (size_t)buffer.size());