From 0f2e588ba2d945fcf6bd812f0eccfc04922d38e0 Mon Sep 17 00:00:00 2001 From: "gregory.hainaut@gmail.com" Date: Sat, 12 Mar 2011 22:38:07 +0000 Subject: [PATCH] gsdx: really close the windows when closing/shutdown emulation git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4422 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/GSdx/GSWnd.cpp | 12 ++++++++++++ plugins/GSdx/GSWnd.h | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/plugins/GSdx/GSWnd.cpp b/plugins/GSdx/GSWnd.cpp index 087c95bff9..f2bed4f142 100644 --- a/plugins/GSdx/GSWnd.cpp +++ b/plugins/GSdx/GSWnd.cpp @@ -321,6 +321,18 @@ GSWnd::~GSWnd() if(m_window != NULL) { SDL_DestroyWindow(m_window); + m_window = NULL; + } +} + +// Actually the destructor is not called when there is a GSclose or GSshutdown +// The window still need to be closed +void GSWnd::Detach() +{ + if(m_window != NULL) + { + SDL_DestroyWindow(m_window); + m_window = NULL; } } diff --git a/plugins/GSdx/GSWnd.h b/plugins/GSdx/GSWnd.h index e719e42869..d2ba81934d 100644 --- a/plugins/GSdx/GSWnd.h +++ b/plugins/GSdx/GSWnd.h @@ -101,7 +101,7 @@ public: bool Create(const string& title, int w, int h); bool Attach(void* handle, bool managed = true) {return false;} - void Detach() {} + void Detach(); bool IsManaged() const {return true;} Display* GetDisplay();