diff --git a/src/SFML/Window/GlContext.cpp b/src/SFML/Window/GlContext.cpp index 40252b493..3c5b4ef9a 100644 --- a/src/SFML/Window/GlContext.cpp +++ b/src/SFML/Window/GlContext.cpp @@ -182,8 +182,9 @@ GlContext* GlContext::New(const ContextSettings& settings, unsigned int width, u //////////////////////////////////////////////////////////// GlContext::~GlContext() { - // Deactivate the context before killing it - SetActive(false); + // Deactivate the context before killing it, unless we're inside Cleanup() + if (sharedContext) + SetActive(false); }