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();