From 233c444255ad1213254abe8760b2ec412e6d3171 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 18 Jan 2025 20:57:15 -0600 Subject: [PATCH] [nostalgia/core] Replace ContextDeleter with safeDelete(Context*) --- .../modules/core/include/nostalgia/core/context.hpp | 6 ++---- .../src/nostalgia/modules/core/src/gba/context.cpp | 4 ++-- .../src/nostalgia/modules/core/src/opengl/context.cpp | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/deps/nostalgia/src/nostalgia/modules/core/include/nostalgia/core/context.hpp b/deps/nostalgia/src/nostalgia/modules/core/include/nostalgia/core/context.hpp index 9fcffb2..2f2df27 100644 --- a/deps/nostalgia/src/nostalgia/modules/core/include/nostalgia/core/context.hpp +++ b/deps/nostalgia/src/nostalgia/modules/core/include/nostalgia/core/context.hpp @@ -17,11 +17,9 @@ namespace nostalgia::core { class Context; -struct ContextDeleter { - void operator()(Context *p) noexcept; -}; +void safeDelete(Context *ctx) noexcept; -using ContextUPtr = ox::UPtr; +using ContextUPtr = ox::UPtr; ox::Result init(turbine::Context &tctx, InitParams const¶ms = {}) noexcept; diff --git a/deps/nostalgia/src/nostalgia/modules/core/src/gba/context.cpp b/deps/nostalgia/src/nostalgia/modules/core/src/gba/context.cpp index d54262d..ab378d3 100644 --- a/deps/nostalgia/src/nostalgia/modules/core/src/gba/context.cpp +++ b/deps/nostalgia/src/nostalgia/modules/core/src/gba/context.cpp @@ -10,8 +10,8 @@ namespace nostalgia::core { -void ContextDeleter::operator()(Context *p) noexcept { - ox::safeDelete(p); +void safeDelete(Context *ctx) noexcept { + delete ctx; } Context::Context(turbine::Context &tctx) noexcept: turbineCtx(tctx) { diff --git a/deps/nostalgia/src/nostalgia/modules/core/src/opengl/context.cpp b/deps/nostalgia/src/nostalgia/modules/core/src/opengl/context.cpp index 0644e9a..fd727bc 100644 --- a/deps/nostalgia/src/nostalgia/modules/core/src/opengl/context.cpp +++ b/deps/nostalgia/src/nostalgia/modules/core/src/opengl/context.cpp @@ -7,8 +7,8 @@ namespace nostalgia::core { -void ContextDeleter::operator()(Context *p) noexcept { - ox::safeDelete(p); +void safeDelete(Context *ctx) noexcept { + delete ctx; } Context::Context(turbine::Context &tctx, InitParams const¶ms) noexcept: