diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index f991362f46d..e98ee2a706b 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -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;