Commit 3cd86c9f authored by Joachim Priesner's avatar Joachim Priesner Committed by Alexandre Julliard

wined3d: Clear active lights when cleaning up a D3D stateblock.

This prevents dangling pointers as the light structures that the pointers in the state->lights array point to are freed below when cleaning the light maps.
parent 22acc5cb
......@@ -539,6 +539,11 @@ void state_cleanup(struct wined3d_state *state)
if (!(state->flags & WINED3D_STATE_NO_REF))
state_unbind_resources(state);
for (counter = 0; counter < MAX_ACTIVE_LIGHTS; ++counter)
{
state->lights[counter] = NULL;
}
for (counter = 0; counter < LIGHTMAP_SIZE; ++counter)
{
struct list *e1, *e2;
......
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