From 85ed0405dffc321bb2a27071816dbf5c27ed9cf3 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 3 Sep 2022 20:47:42 +0100 Subject: Initialize some variables inline instead of in the constructor. --- src/threadsocket.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/threadsocket.cpp') diff --git a/src/threadsocket.cpp b/src/threadsocket.cpp index 86b36eac0..323376b98 100644 --- a/src/threadsocket.cpp +++ b/src/threadsocket.cpp @@ -29,7 +29,9 @@ class ThreadSignalSocket final : public EventHandler { - SocketThread* parent; +private: + SocketThread* parent = nullptr; + public: ThreadSignalSocket(SocketThread* p, int newfd) : parent(p) { @@ -67,10 +69,10 @@ public: SocketThread::SocketThread() { - socket = nullptr; int fd = eventfd(0, EFD_NONBLOCK); if (fd < 0) throw CoreException("Could not create pipe " + std::string(strerror(errno))); + socket = new ThreadSignalSocket(this, fd); } #else -- cgit v1.3.1-10-gc9f91