From 80c6dcd25ef96df6885a55cdd23900ae55f30bab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 5 Jun 2014 13:07:27 +0200
Subject: wined3d: Set map_heap_memory = NULL when allocating a PBO.

Otherwise the next unmap will re-assign it with the resource_changed
message. Freeing the actual memory and setting the read pointer to 0 is
the task of the worker thread.

Wined3d_resource_prepare_bo is only called if the map binding is
LOCATION_BUFFER, and map_heap_memory is only used if the map binding is
LOCATION_SYSMEM.
---
 dlls/wined3d/resource.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 671ab50..1dff0ed 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -616,6 +616,7 @@ static void wined3d_resource_prepare_bo(struct wined3d_resource *resource, struc
             GL_STREAM_DRAW, GL_PIXEL_UNPACK_BUFFER, context);
     resource->map_buffer = resource->buffer;
     TRACE("Created GL buffer %u for resource %p.\n", resource->buffer->name, resource);
+    resource->map_heap_memory = NULL;
 }
 
 BOOL wined3d_resource_prepare_system_memory(struct wined3d_resource *resource)
-- 
2.2.1

