Commit e2845104 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

winex11: Avoid leaking foreign window data if it was already created.

NtUserCreateWindowEx will call apply_window_pos and drivers WindowPosChanging callback, which already creates window data.
parent 97cb5b9c
...@@ -2229,15 +2229,12 @@ HWND create_foreign_window( Display *display, Window xwin ) ...@@ -2229,15 +2229,12 @@ HWND create_foreign_window( Display *display, Window xwin )
hwnd = NtUserCreateWindowEx( 0, &class_name, &class_name, NULL, style, pos.x, pos.y, hwnd = NtUserCreateWindowEx( 0, &class_name, &class_name, NULL, style, pos.x, pos.y,
attr.width, attr.height, parent, 0, NULL, NULL, 0, NULL, attr.width, attr.height, parent, 0, NULL, NULL, 0, NULL,
0, FALSE ); 0, FALSE );
if (!(data = get_win_data( hwnd )))
if (!(data = alloc_win_data( display, hwnd )))
{ {
NtUserDestroyWindow( hwnd ); NtUserDestroyWindow( hwnd );
return 0; return 0;
} }
SetRect( &data->window_rect, pos.x, pos.y, pos.x + attr.width, pos.y + attr.height ); destroy_whole_window( data, FALSE );
data->whole_rect = data->client_rect = data->window_rect;
data->whole_window = data->client_window = 0;
data->embedded = TRUE; data->embedded = TRUE;
data->mapped = TRUE; data->mapped = TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment