diff --git a/mesosphere/include/mesosphere/interfaces/IClientServerParent.hpp b/mesosphere/include/mesosphere/interfaces/IClientServerParent.hpp index 2a87465dd..8399c0ea6 100644 --- a/mesosphere/include/mesosphere/interfaces/IClientServerParent.hpp +++ b/mesosphere/include/mesosphere/interfaces/IClientServerParent.hpp @@ -22,7 +22,7 @@ class IClientServerParent : public IClientServerParentTag { { Parent *par = (Parent *)this; client.SetParent(par); - server.SetParentAndClient(par, &client); + server.SetParentAndClient(par); } ClientClass &GetClient() { return client; } diff --git a/mesosphere/include/mesosphere/interfaces/IServer.hpp b/mesosphere/include/mesosphere/interfaces/IServer.hpp index 5b015351c..5935802de 100644 --- a/mesosphere/include/mesosphere/interfaces/IServer.hpp +++ b/mesosphere/include/mesosphere/interfaces/IServer.hpp @@ -23,16 +23,14 @@ class IServer : public IServerTag { const SharedPtr &GetParent() const { return parent; } - void SetParentAndClient(SharedPtr parent, SharedPtr client) + void SetParentAndClient(SharedPtr parent) { this->parent = std::move(parent); - this->client = std::move(client); } protected: SharedPtr parent{}; - SharedPtr client{}; }; } diff --git a/mesosphere/include/mesosphere/processes/KWritableEvent.hpp b/mesosphere/include/mesosphere/processes/KWritableEvent.hpp index 612178282..c19ebcd4d 100644 --- a/mesosphere/include/mesosphere/processes/KWritableEvent.hpp +++ b/mesosphere/include/mesosphere/processes/KWritableEvent.hpp @@ -21,6 +21,11 @@ class KWritableEvent final : public KAutoObject, public IServer client); + + private: + SharedPtr client{}; }; inline void intrusive_ptr_add_ref(KWritableEvent *obj) diff --git a/mesosphere/source/processes/KEvent.cpp b/mesosphere/source/processes/KEvent.cpp index 251459037..d747215ba 100644 --- a/mesosphere/source/processes/KEvent.cpp +++ b/mesosphere/source/processes/KEvent.cpp @@ -11,6 +11,7 @@ KEvent::~KEvent() Result KEvent::Initialize() { SetClientServerParent(); + server.SetClient(&client); SetResourceOwner(KCoreContext::GetCurrentInstance().GetCurrentProcess()); return ResultSuccess(); diff --git a/mesosphere/source/processes/KWritableEvent.cpp b/mesosphere/source/processes/KWritableEvent.cpp index ea6c49952..16dfffe0c 100644 --- a/mesosphere/source/processes/KWritableEvent.cpp +++ b/mesosphere/source/processes/KWritableEvent.cpp @@ -19,4 +19,9 @@ Result KWritableEvent::Clear() return client->Clear(); } +void KWritableEvent::SetClient(SharedPtr client) +{ + this->client = std::move(client); +} + }