From 7e7ce73cacdefd54003b4b97dc295c5be2f36f8f Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 19 Feb 2017 08:29:23 +0100
Subject: wined3d: Reset context before destruction.

---
 dlls/wined3d/adapter_gl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c
index 1f4ba793e..a39c78424 100644
--- a/dlls/wined3d/adapter_gl.c
+++ b/dlls/wined3d/adapter_gl.c
@@ -4595,6 +4595,7 @@ static void adapter_gl_uninit_3d(struct wined3d_device *device)
 {
     TRACE("device %p.\n", device);
 
+    context_set_current(NULL);
     wined3d_cs_destroy_object(device->cs, wined3d_device_delete_opengl_contexts_cs, device);
     wined3d_cs_finish(device->cs, WINED3D_CS_QUEUE_DEFAULT);
 }
-- 
2.21.0

