wined3d: Fix not released swapchain in some codepaths.

This commit is contained in:
Alexander Dorofeyev 2008-01-20 20:18:12 -08:00 committed by Alexandre Julliard
parent 320e253805
commit d9567b7627
1 changed files with 2 additions and 1 deletions

View File

@ -1121,13 +1121,14 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_UnlockRect(IWineD3DSurface *iface) {
IWineD3DSurface_GetContainer(iface, &IID_IWineD3DSwapChain, (void **)&swapchain);
if(swapchain || (myDevice->render_targets && iface == myDevice->render_targets[0])) {
if(swapchain) IWineD3DSwapChain_Release((IWineD3DSwapChain *) swapchain);
if(wined3d_settings.rendertargetlock_mode == RTL_DISABLE) {
static BOOL warned = FALSE;
if(!warned) {
ERR("The application tries to write to the render target, but render target locking is disabled\n");
warned = TRUE;
}
if(swapchain) IWineD3DSwapChain_Release((IWineD3DSwapChain *) swapchain);
goto unlock_end;
}