Clean up properly if the grab fails. (finish_drag): Don't leak a reference

2006-01-11  Matthias Clasen  <mclasen@redhat.com>

	* gdk/x11/gdkwindow-x11.c (create_moveresize_window): Clean
	up properly if the grab fails.
	(finish_drag): Don't leak a reference to moveresize_window
	here.
This commit is contained in:
Matthias Clasen 2006-01-11 14:54:05 +00:00 committed by Matthias Clasen
parent 29b890f951
commit 5453f11464
3 changed files with 16 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2006-01-11 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkwindow-x11.c (create_moveresize_window): Clean
up properly if the grab fails.
(finish_drag): Don't leak a reference to moveresize_window
here.
2006-01-11 Matthias Clasen <mclasen@redhat.com> 2006-01-11 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkevents-x11.c: Fix string offsets. * gdk/x11/gdkevents-x11.c: Fix string offsets.

View File

@ -1,3 +1,10 @@
2006-01-11 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkwindow-x11.c (create_moveresize_window): Clean
up properly if the grab fails.
(finish_drag): Don't leak a reference to moveresize_window
here.
2006-01-11 Matthias Clasen <mclasen@redhat.com> 2006-01-11 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkevents-x11.c: Fix string offsets. * gdk/x11/gdkevents-x11.c: Fix string offsets.

View File

@ -5607,6 +5607,7 @@ finish_drag (MoveResizeData *mv_resize)
{ {
gdk_window_destroy (mv_resize->moveresize_emulation_window); gdk_window_destroy (mv_resize->moveresize_emulation_window);
mv_resize->moveresize_emulation_window = NULL; mv_resize->moveresize_emulation_window = NULL;
g_object_unref (mv_resize->moveresize_window);
mv_resize->moveresize_window = NULL; mv_resize->moveresize_window = NULL;
if (mv_resize->moveresize_pending_event) if (mv_resize->moveresize_pending_event)
@ -5786,8 +5787,7 @@ create_moveresize_window (MoveResizeData *mv_resize,
/* If this fails, some other client has grabbed the window /* If this fails, some other client has grabbed the window
* already. * already.
*/ */
gdk_window_destroy (mv_resize->moveresize_emulation_window); finish_drag (mv_resize);
mv_resize->moveresize_emulation_window = NULL;
} }
mv_resize->moveresize_process_time = 0; mv_resize->moveresize_process_time = 0;