summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/svc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
-rw-r--r--src/core/hle/kernel/svc.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index 17d63658a..b143a51c7 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -1953,14 +1953,11 @@ static ResultCode CreateEvent(Core::System& system, Handle* out_write, Handle* o
HandleTable& handle_table = kernel.CurrentProcess()->GetHandleTable();
// Create a new event.
- const auto event = KEvent::Create(kernel, "CreateEvent");
- if (!event) {
- LOG_ERROR(Kernel_SVC, "Unable to create new events. Event creation limit reached.");
- return ResultOutOfResource;
- }
+ KEvent* event = KEvent::CreateWithKernel(kernel);
+ R_UNLESS(event != nullptr, ResultOutOfResource);
// Initialize the event.
- event->Initialize();
+ event->Initialize("CreateEvent");
// Add the writable event to the handle table.
const auto write_create_result = handle_table.Create(event->GetWritableEvent().get());