[PATCH 2/5] wined3d: Don't try to access the swapchain of a destroyed context in context_set_gl_context().

Henri Verbeet hverbeet at codeweavers.com
Sun Oct 16 14:55:30 CDT 2011


---
 dlls/wined3d/context.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 3353434..ef8b94e 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -768,6 +768,17 @@ static BOOL context_set_gl_context(struct wined3d_context *ctx)
         ctx->valid = 0;
         WARN("Trying fallback to the backup window.\n");
 
+        /* FIXME: If the context is destroyed it's no longer associated with
+         * a swapchain, so we can't use the swapchain to get a backup dc. To
+         * make this work windowless contexts would need to be handled by the
+         * device. */
+        if (ctx->destroyed)
+        {
+            FIXME("Unable to get backup dc for destroyed context %p.\n", ctx);
+            context_set_current(NULL);
+            return FALSE;
+        }
+
         if (!(dc = swapchain_get_backup_dc(swapchain)))
         {
             context_set_current(NULL);
-- 
1.7.3.4




More information about the wine-patches mailing list