diff options
| author | bunnei <bunneidev@gmail.com> | 2021-05-07 23:30:17 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-07 23:30:17 -0700 |
| commit | faa067f175cbf5e916ed75776817f0046e6731c4 (patch) | |
| tree | 8ab02a72a6e4d6578848c8da2c02af02684aeec7 /src/core/hle/service/friend | |
| parent | 8acf739b3fac78d25dc60e1a7d1252c05afadd57 (diff) | |
| parent | d57b12193b12f7b6e3565d29f7bc3d7584632768 (diff) | |
Merge pull request #6266 from bunnei/kautoobject-refactor
Kernel Rework: Migrate kernel objects to KAutoObject
Diffstat (limited to 'src/core/hle/service/friend')
| -rw-r--r-- | src/core/hle/service/friend/friend.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/hle/service/friend/friend.cpp b/src/core/hle/service/friend/friend.cpp index a35979053..91c202952 100644 --- a/src/core/hle/service/friend/friend.cpp +++ b/src/core/hle/service/friend/friend.cpp @@ -185,7 +185,8 @@ private: class INotificationService final : public ServiceFramework<INotificationService> { public: explicit INotificationService(Common::UUID uuid_, Core::System& system_) - : ServiceFramework{system_, "INotificationService"}, uuid{uuid_} { + : ServiceFramework{system_, "INotificationService"}, uuid{uuid_}, notification_event{ + system.Kernel()} { // clang-format off static const FunctionInfo functions[] = { {0, &INotificationService::GetEvent, "GetEvent"}, @@ -196,9 +197,8 @@ public: RegisterHandlers(functions); - notification_event = - Kernel::KEvent::Create(system.Kernel(), "INotificationService:NotifyEvent"); - notification_event->Initialize(); + Kernel::KAutoObject::Create(std::addressof(notification_event)); + notification_event.Initialize("INotificationService:NotifyEvent"); } private: @@ -207,7 +207,7 @@ private: IPC::ResponseBuilder rb{ctx, 2, 1}; rb.Push(RESULT_SUCCESS); - rb.PushCopyObjects(notification_event->GetReadableEvent()); + rb.PushCopyObjects(notification_event.GetReadableEvent()); } void Clear(Kernel::HLERequestContext& ctx) { @@ -273,7 +273,7 @@ private: }; Common::UUID uuid{Common::INVALID_UUID}; - std::shared_ptr<Kernel::KEvent> notification_event; + Kernel::KEvent notification_event; std::queue<SizedNotificationInfo> notifications; States states{}; }; |
