Matteo Bruni : wined3d: Make a copy of gl_info for later context_destroy_gl_resources() usage.

Alexandre Julliard julliard at winehq.org
Tue Nov 15 13:17:34 CST 2011


Module: wine
Branch: master
Commit: 1fd18d768845ab8ec965a57c5a8783aba1cc0c68
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=1fd18d768845ab8ec965a57c5a8783aba1cc0c68

Author: Matteo Bruni <mbruni at codeweavers.com>
Date:   Tue Nov 15 14:21:08 2011 +0100

wined3d: Make a copy of gl_info for later context_destroy_gl_resources() usage.

---

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

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 355dccf..9b0ae05 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -1027,6 +1027,7 @@ BOOL context_set_current(struct wined3d_context *ctx)
         {
             TRACE("Switching away from destroyed context %p.\n", old);
             context_destroy_gl_resources(old);
+            HeapFree(GetProcessHeap(), 0, (void *)old->gl_info);
             HeapFree(GetProcessHeap(), 0, old);
         }
         else
@@ -1603,6 +1604,11 @@ void context_destroy(struct wined3d_device *device, struct wined3d_context *cont
     }
     else
     {
+        /* Make a copy of gl_info for context_destroy_gl_resources use, the one
+           in wined3d_adapter may go away in the meantime */
+        struct wined3d_gl_info *gl_info = HeapAlloc(GetProcessHeap(), 0, sizeof(*gl_info));
+        *gl_info = *context->gl_info;
+        context->gl_info = gl_info;
         context->destroyed = 1;
         destroy = FALSE;
     }




More information about the wine-cvs mailing list