Commit d9dd5c9c authored by Felipe Borges's avatar Felipe Borges 👣

frdp-session, display: Disconnect session when display is destroyed

parent f04c5a33
......@@ -187,6 +187,19 @@ frdp_display_open_host_cb (GObject *source_object,
}
}
static void
frdp_display_destroy (GtkWidget *widget)
{
FrdpDisplay *self = FRDP_DISPLAY (widget);
if (self->priv->session != NULL) {
g_object_unref (self->priv->session);
self->priv->session = NULL;
}
GTK_WIDGET_CLASS (frdp_display_parent_class)->destroy (widget);
}
static void
frdp_display_get_property (GObject *object,
guint property_id,
......@@ -258,6 +271,7 @@ frdp_display_class_init (FrdpDisplayClass *klass)
widget_class->button_press_event = frdp_display_button_press_event;
widget_class->button_release_event = frdp_display_button_press_event;
widget_class->scroll_event = frdp_display_scroll_event;
widget_class->destroy = frdp_display_destroy;
g_object_class_install_property (gobject_class,
PROP_USERNAME,
......
......@@ -464,6 +464,13 @@ frdp_session_finalize (GObject *object)
self->priv->update_id = 0;
}
if (self->priv->freerdp_session) {
gdi_free (self->priv->freerdp_session);
freerdp_disconnect (self->priv->freerdp_session);
freerdp_context_free (self->priv->freerdp_session);
g_clear_pointer (&self->priv->freerdp_session, freerdp_free);
}
G_OBJECT_CLASS (frdp_session_parent_class)->finalize (object);
}
......
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