[PATCH 1/2] Handle refcount of lights when interacting with viewport.

Henri Verbeet hverbeet at gmail.com
Sun Apr 19 16:21:26 CDT 2009


2009/4/19 Christian Costa <titan.costa at wanadoo.fr>:
> @@ -760,6 +760,8 @@ IDirect3DViewportImpl_AddLight(IDirect3DViewport3 *iface,
>          lpDirect3DLightImpl->activate(lpDirect3DLightImpl);
>      }
>
> +    IDirect3DLight_AddRef(lpDirect3DLight);
> +
>      LeaveCriticalSection(&ddraw_cs);
>      return D3D_OK;
>  }
> @@ -798,6 +800,7 @@ IDirect3DViewportImpl_DeleteLight(IDirect3DViewport3 *iface,
>  	    cur_light->active_viewport = NULL;
>  	    This->num_lights--;
>  	    This->map_lights &= ~(1<<lpDirect3DLightImpl->dwLightIndex);
> +            IDirect3DLight_Release(lpDirect3DLight);
>              LeaveCriticalSection(&ddraw_cs);
>              return D3D_OK;
>  	}
The patch looks ok in principle, but I think it's nicer to keep these
close to the code that actually manipulates the list.



More information about the wine-devel mailing list