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

[virt-tools-list] [virt-viewer 1/3] Don't leak SpiceGrabSequence in enable_accel_changed



---
 src/virt-viewer-display-spice.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/virt-viewer-display-spice.c b/src/virt-viewer-display-spice.c
index 753e369..b5f4859 100644
--- a/src/virt-viewer-display-spice.c
+++ b/src/virt-viewer-display-spice.c
@@ -224,9 +224,10 @@ enable_accel_changed(VirtViewerApp *app,
                      VirtViewerDisplaySpice *self)
 {
     if (virt_viewer_app_get_enable_accel(app)) {
+        SpiceGrabSequence *seq = spice_grab_sequence_new(0, NULL);
         /* disable default grab sequence */
-        spice_display_set_grab_keys(self->priv->display,
-                                    spice_grab_sequence_new(0, NULL));
+        spice_display_set_grab_keys(self->priv->display, seq);
+        spice_grab_sequence_free(seq);
     } else {
         spice_display_set_grab_keys(self->priv->display, NULL);
     }
-- 
1.8.0.1


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