From a05dcd911ebaf64138d330ecf5db3e3ce8700bda Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Tue, 11 Mar 2014 18:41:47 +0100 Subject: [PATCH] wined3d: Handle shader_arb_free_context_data() during context creation. --- dlls/wined3d/arb_program_shader.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index d7e9ef76428..1eab0eb876b 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -5052,8 +5052,12 @@ static BOOL shader_arb_allocate_context_data(struct wined3d_context *context) static void shader_arb_free_context_data(struct wined3d_context *context) { - struct shader_arb_priv *priv = context->swapchain->device->shader_priv; + struct shader_arb_priv *priv; + if (!context->swapchain) + return; + + priv = context->swapchain->device->shader_priv; if (priv->last_context == context) priv->last_context = NULL; }