Commit a4104c7c authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Avoid accessing the device after deactivation some more.

parent 4cabe361
...@@ -5315,9 +5315,13 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL ...@@ -5315,9 +5315,13 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
} }
else if (message == WM_ACTIVATEAPP) else if (message == WM_ACTIVATEAPP)
{ {
UINT i; unsigned int i = device->swapchain_count;
for (i = 0; i < device->swapchain_count; i++) /* Deactivating the implicit swapchain may cause the application
* (e.g. Deus Ex: GOTY) to destroy the device, so take care to
* deactivate the implicit swapchain last, and to avoid accessing the
* "device" pointer afterwards. */
while (i--)
wined3d_swapchain_activate(device->swapchains[i], wparam); wined3d_swapchain_activate(device->swapchains[i], wparam);
} }
else if (message == WM_SYSCOMMAND) else if (message == WM_SYSCOMMAND)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment