mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-01-10 11:26:15 +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;
|
Parent *par = (Parent *)this;
|
||||||
client.SetParent(par);
|
client.SetParent(par);
|
||||||
server.SetParentAndClient(par, &client);
|
server.SetParentAndClient(par);
|
||||||
}
|
}
|
||||||
|
|
||||||
ClientClass &GetClient() { return client; }
|
ClientClass &GetClient() { return client; }
|
||||||
|
|
|
@ -23,16 +23,14 @@ class IServer : public IServerTag {
|
||||||
|
|
||||||
const SharedPtr<Parent> &GetParent() const { return parent; }
|
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->parent = std::move(parent);
|
||||||
this->client = std::move(client);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
SharedPtr<Parent> parent{};
|
SharedPtr<Parent> parent{};
|
||||||
SharedPtr<Client> client{};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,11 @@ class KWritableEvent final : public KAutoObject, public IServer<KEvent, KReadabl
|
||||||
|
|
||||||
Result Signal();
|
Result Signal();
|
||||||
Result Clear();
|
Result Clear();
|
||||||
|
|
||||||
|
void SetClient(SharedPtr<KReadableEvent> client);
|
||||||
|
|
||||||
|
private:
|
||||||
|
SharedPtr<KReadableEvent> client{};
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void intrusive_ptr_add_ref(KWritableEvent *obj)
|
inline void intrusive_ptr_add_ref(KWritableEvent *obj)
|
||||||
|
|
|
@ -11,6 +11,7 @@ KEvent::~KEvent()
|
||||||
Result KEvent::Initialize()
|
Result KEvent::Initialize()
|
||||||
{
|
{
|
||||||
SetClientServerParent();
|
SetClientServerParent();
|
||||||
|
server.SetClient(&client);
|
||||||
SetResourceOwner(KCoreContext::GetCurrentInstance().GetCurrentProcess());
|
SetResourceOwner(KCoreContext::GetCurrentInstance().GetCurrentProcess());
|
||||||
|
|
||||||
return ResultSuccess();
|
return ResultSuccess();
|
||||||
|
|
|
@ -19,4 +19,9 @@ Result KWritableEvent::Clear()
|
||||||
return client->Clear();
|
return client->Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void KWritableEvent::SetClient(SharedPtr<KReadableEvent> client)
|
||||||
|
{
|
||||||
|
this->client = std::move(client);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue