Alexandre Julliard : winex11: Hold a reference to the surface in UpdateLayeredWindow.
Alexandre Julliard
julliard at winehq.org
Thu Oct 4 13:38:36 CDT 2012
Module: wine
Branch: master
Commit: 2500e21a90a085f34ad7433e362aa05fa37b0692
URL: http://source.winehq.org/git/wine.git/?a=commit;h=2500e21a90a085f34ad7433e362aa05fa37b0692
Author: Alexandre Julliard <julliard at winehq.org>
Date: Thu Oct 4 10:34:41 2012 +0200
winex11: Hold a reference to the surface in UpdateLayeredWindow.
---
dlls/winex11.drv/window.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 052eafa..7c8f391 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -2386,11 +2386,15 @@ BOOL CDECL X11DRV_UpdateLayeredWindow( HWND hwnd, const UPDATELAYEREDWINDOWINFO
}
else set_surface_color_key( surface, color_key );
+ if (surface) window_surface_add_ref( surface );
release_win_data( data );
if (!surface) return FALSE;
- if (!info->hdcSrc) return TRUE;
- if (info->prcDirty && !IntersectRect( &rect, &rect, info->prcDirty )) return TRUE;
+ if (!info->hdcSrc)
+ {
+ window_surface_release( surface );
+ return TRUE;
+ }
dst_bits = surface->funcs->get_info( surface, bmi );
@@ -2403,6 +2407,7 @@ BOOL CDECL X11DRV_UpdateLayeredWindow( HWND hwnd, const UPDATELAYEREDWINDOWINFO
if (info->prcDirty)
{
+ IntersectRect( &rect, &rect, info->prcDirty );
memcpy( src_bits, dst_bits, bmi->bmiHeader.biSizeImage );
PatBlt( hdc, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, BLACKNESS );
}
@@ -2422,6 +2427,7 @@ BOOL CDECL X11DRV_UpdateLayeredWindow( HWND hwnd, const UPDATELAYEREDWINDOWINFO
surface->funcs->flush( surface );
done:
+ window_surface_release( surface );
if (hdc) DeleteDC( hdc );
if (dib) DeleteObject( dib );
return ret;
More information about the wine-cvs
mailing list