all repos — mgba @ 08ec1e89c41606c5ae99005aaf665d1d4e254f56

mGBA Game Boy Advance Emulator

Qt: Work around invalid new/delete semantics
Vicki Pfau vi@endrift.com
Wed, 04 Jul 2018 12:47:37 -0700
commit

08ec1e89c41606c5ae99005aaf665d1d4e254f56

parent

3be77c162247f5380bd1ec226ab4bf7ab800efcb

1 files changed, 3 insertions(+), 3 deletions(-)

jump to
M src/platform/qt/DisplayGL.cppsrc/platform/qt/DisplayGL.cpp

@@ -180,7 +180,7 @@ #endif

#if !defined(_WIN32) || defined(USE_EPOXY) if (majorVersion >= 2) { - gl2Backend = new mGLES2Context; + gl2Backend = static_cast<mGLES2Context*>(malloc(sizeof(mGLES2Context))); mGLES2ContextCreate(gl2Backend); m_backend = &gl2Backend->d; m_supportsShaders = true;

@@ -189,7 +189,7 @@ #endif

#ifdef BUILD_GL if (!m_backend) { - glBackend = new mGLContext; + glBackend = static_cast<mGLContext*>(malloc(sizeof(mGLContext))); mGLContextCreate(glBackend); m_backend = &glBackend->d; m_supportsShaders = false;

@@ -239,7 +239,7 @@ }

#endif m_backend->deinit(m_backend); m_gl->doneCurrent(); - delete m_backend; + free(m_backend); m_backend = nullptr; }