[mutter] backend-x11: Fix leak of the event data



commit 97074ccdadb5fab16e647a3f85519a6cf8972753
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Apr 23 15:17:21 2014 -0400

    backend-x11: Fix leak of the event data

 src/backends/x11/meta-backend-x11.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/backends/x11/meta-backend-x11.c b/src/backends/x11/meta-backend-x11.c
index 5e07d56..d47c83d 100644
--- a/src/backends/x11/meta-backend-x11.c
+++ b/src/backends/x11/meta-backend-x11.c
@@ -84,8 +84,6 @@ maybe_spoof_event_as_stage_event (MetaBackendX11 *x11,
   if (event->type == GenericEvent &&
       event->xcookie.extension == priv->xinput_opcode)
     {
-      XGetEventData (priv->xdisplay, &event->xcookie);
-
       XIEvent *input_event = (XIEvent *) event->xcookie.data;
       XIDeviceEvent *device_event = ((XIDeviceEvent *) input_event);
 
@@ -115,6 +113,8 @@ handle_host_xevent (MetaBackend *backend,
   MetaBackendX11Private *priv = meta_backend_x11_get_instance_private (x11);
   gboolean bypass_clutter = FALSE;
 
+  XGetEventData (priv->xdisplay, &event->xcookie);
+
   if (event->type == (priv->xsync_event_base + XSyncAlarmNotify))
     handle_alarm_notify (backend, event);
 
@@ -133,6 +133,8 @@ handle_host_xevent (MetaBackend *backend,
  out:
   if (!bypass_clutter)
     clutter_x11_handle_event (event);
+
+  XFreeEventData (priv->xdisplay, &event->xcookie);
 }
 
 typedef struct {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]