Alexandre Julliard : winex11: Add window data structure locking to the ReparentNotify event handler.

Alexandre Julliard julliard at winehq.org
Wed Sep 19 13:39:45 CDT 2012


Module: wine
Branch: master
Commit: 89a60562a71c5322c11df875609b0f9e0beb96bf
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=89a60562a71c5322c11df875609b0f9e0beb96bf

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Sep 19 13:13:40 2012 +0200

winex11: Add window data structure locking to the ReparentNotify event handler.

---

 dlls/winex11.drv/event.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c
index d58919c..744bc40 100644
--- a/dlls/winex11.drv/event.c
+++ b/dlls/winex11.drv/event.c
@@ -938,8 +938,13 @@ static void X11DRV_ReparentNotify( HWND hwnd, XEvent *xev )
     HWND parent, old_parent;
     DWORD style;
 
-    if (!(data = X11DRV_get_win_data( hwnd ))) return;
-    if (!data->embedded) return;
+    if (!(data = get_win_data( hwnd ))) return;
+
+    if (!data->embedded)
+    {
+        release_win_data( data );
+        return;
+    }
 
     if (data->whole_window)
     {
@@ -947,6 +952,7 @@ static void X11DRV_ReparentNotify( HWND hwnd, XEvent *xev )
         {
             TRACE( "%p/%lx reparented to root\n", hwnd, data->whole_window );
             data->embedder = 0;
+            release_win_data( data );
             SendMessageW( hwnd, WM_CLOSE, 0, 0 );
             return;
         }
@@ -954,6 +960,7 @@ static void X11DRV_ReparentNotify( HWND hwnd, XEvent *xev )
     }
 
     TRACE( "%p/%lx reparented to %lx\n", hwnd, data->whole_window, event->parent );
+    release_win_data( data );
 
     style = GetWindowLongW( hwnd, GWL_STYLE );
     if (event->parent == root_window)




More information about the wine-cvs mailing list