mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2024-12-22 20:31:14 +00:00
Remove IServer client ref
This commit is contained in:
parent
1b3b26c3af
commit
195da2e599
5 changed files with 13 additions and 4 deletions
|
@ -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; }
|
||||
|
|
|
@ -23,16 +23,14 @@ class IServer : public IServerTag {
|
|||
|
||||
const SharedPtr<Parent> &GetParent() const { return parent; }
|
||||
|
||||
void SetParentAndClient(SharedPtr<Parent> parent, SharedPtr<Client> client)
|
||||
void SetParentAndClient(SharedPtr<Parent> parent)
|
||||
{
|
||||
this->parent = std::move(parent);
|
||||
this->client = std::move(client);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
SharedPtr<Parent> parent{};
|
||||
SharedPtr<Client> client{};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -21,6 +21,11 @@ class KWritableEvent final : public KAutoObject, public IServer<KEvent, KReadabl
|
|||
|
||||
Result Signal();
|
||||
Result Clear();
|
||||
|
||||
void SetClient(SharedPtr<KReadableEvent> client);
|
||||
|
||||
private:
|
||||
SharedPtr<KReadableEvent> client{};
|
||||
};
|
||||
|
||||
inline void intrusive_ptr_add_ref(KWritableEvent *obj)
|
||||
|
|
|
@ -11,6 +11,7 @@ KEvent::~KEvent()
|
|||
Result KEvent::Initialize()
|
||||
{
|
||||
SetClientServerParent();
|
||||
server.SetClient(&client);
|
||||
SetResourceOwner(KCoreContext::GetCurrentInstance().GetCurrentProcess());
|
||||
|
||||
return ResultSuccess();
|
||||
|
|
|
@ -19,4 +19,9 @@ Result KWritableEvent::Clear()
|
|||
return client->Clear();
|
||||
}
|
||||
|
||||
void KWritableEvent::SetClient(SharedPtr<KReadableEvent> client)
|
||||
{
|
||||
this->client = std::move(client);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue