diff --git a/src/nostalgia/core/glfw/core.cpp b/src/nostalgia/core/glfw/core.cpp index 477f0e0d..48a43db5 100644 --- a/src/nostalgia/core/glfw/core.cpp +++ b/src/nostalgia/core/glfw/core.cpp @@ -58,7 +58,7 @@ ox::Error run(Context *ctx) noexcept { renderer::shutdown(ctx, ctx->rendererData()); glfwDestroyWindow(id->window); ctx->setWindowerData(nullptr); - delete id; + ox::safeDelete(id); return OxError(0); } diff --git a/src/nostalgia/core/userland/gfx_opengl.cpp b/src/nostalgia/core/userland/gfx_opengl.cpp index 339507df..c8c15dce 100644 --- a/src/nostalgia/core/userland/gfx_opengl.cpp +++ b/src/nostalgia/core/userland/gfx_opengl.cpp @@ -196,7 +196,7 @@ ox::Error init(Context *ctx, void **rendererData) noexcept { void shutdown(Context*, void *rendererData) noexcept { const auto id = reinterpret_cast(rendererData); - delete id; + ox::safeDelete(id); } void loadBgTexture(void *rendererData, int section, void *pixels, int w, int h) noexcept { diff --git a/src/nostalgia/core/userland/media.cpp b/src/nostalgia/core/userland/media.cpp index 6fba4663..baddf126 100644 --- a/src/nostalgia/core/userland/media.cpp +++ b/src/nostalgia/core/userland/media.cpp @@ -29,7 +29,7 @@ ox::Result loadRom(const char *path) noexcept { } void unloadRom(char *rom) noexcept { - delete rom; + ox::safeDelete(rom); } } diff --git a/src/nostalgia/world/world.cpp b/src/nostalgia/world/world.cpp index 5bcf9421..fad04513 100644 --- a/src/nostalgia/world/world.cpp +++ b/src/nostalgia/world/world.cpp @@ -17,7 +17,7 @@ ox::Error Zone::init(Context *ctx, Bounds bnds, ox::FileAddress tileSheet, ox::F } Zone::~Zone() { - delete[] m_tiles; + ox::safeDeleteArray(m_tiles); } void Zone::draw(Context *ctx) {