[vinagre/wip/oholy/fix-rdp-build-2: 5/5] Fix crashes when certificate is not accepted



commit 81f235f9bdb0e46f362e14811fbe83759232ba37
Author: Ondrej Holy <oholy redhat com>
Date:   Fri Feb 8 10:25:20 2019 +0100

    Fix crashes when certificate is not accepted
    
    Vinagre crashes if the certificate is not accepted by user, because
    `emit_delayed_signal` is invoked after the rdp tab disposal. Let's
    remove the idle source during disposal to prevent the crash.

 plugins/rdp/vinagre-rdp-tab.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/plugins/rdp/vinagre-rdp-tab.c b/plugins/rdp/vinagre-rdp-tab.c
index 4e0f937..bbb8adf 100644
--- a/plugins/rdp/vinagre-rdp-tab.c
+++ b/plugins/rdp/vinagre-rdp-tab.c
@@ -46,6 +46,7 @@ struct _VinagreRdpTabPrivate
   cairo_surface_t *surface;
   GQueue          *events;
 
+  guint            intialized_id;
   guint            update_id;
   guint            button_press_handler_id;
   guint            button_release_handler_id;
@@ -181,6 +182,12 @@ vinagre_rdp_tab_dispose (GObject *object)
       g_clear_pointer (&priv->events, g_queue_free);
     }
 
+  if (priv->intialized_id > 0)
+    {
+      g_source_remove (rdp_tab->priv->intialized_id);
+      rdp_tab->priv->intialized_id = 0;
+    }
+
   if (priv->update_id > 0)
     {
       g_source_remove (rdp_tab->priv->update_id);
@@ -239,7 +246,7 @@ vinagre_rdp_tab_constructed (GObject *object)
   setup_toolbar (rdp_tab);
   open_freerdp (rdp_tab);
 
-  g_idle_add ((GSourceFunc) emit_delayed_signal, object);
+  rdp_tab->priv->intialized_id = g_idle_add ((GSourceFunc) emit_delayed_signal, object);
 }
 
 static void


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