From a1d5833c8aa2f85817ad3c3cd64e0e618e8c695e Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 30 Jun 2018 11:06:41 +0300 Subject: [PATCH] - reset framebuffer pointer on destruction in Cocoa backend Added debug validation of framebuffer pointer as well --- src/posix/cocoa/i_video.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/posix/cocoa/i_video.mm b/src/posix/cocoa/i_video.mm index f4f03f2df..b3e422a26 100644 --- a/src/posix/cocoa/i_video.mm +++ b/src/posix/cocoa/i_video.mm @@ -386,6 +386,7 @@ SystemGLFrameBuffer::SystemGLFrameBuffer(void*, const bool fullscreen) } } + assert(frameBuffer == nullptr); frameBuffer = this; FConsoleWindow::GetInstance().Show(false); @@ -393,6 +394,9 @@ SystemGLFrameBuffer::SystemGLFrameBuffer(void*, const bool fullscreen) SystemGLFrameBuffer::~SystemGLFrameBuffer() { + assert(frameBuffer == this); + frameBuffer = nullptr; + NSNotificationCenter* nc = [NSNotificationCenter defaultCenter]; [nc removeObserver:m_window name:NSWindowDidMoveNotification