[gtk-frdp/improve-connection-initialization: 3/3] display: Avoid closing connection twice




commit f591dcf456a1e126c0cdf6e49d436485556d8999
Author: Felipe Borges <felipeborges gnome org>
Date:   Fri Aug 6 09:48:51 2021 +0200

    display: Avoid closing connection twice

 src/frdp-display.c | 2 --
 src/frdp-session.c | 4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/src/frdp-display.c b/src/frdp-display.c
index 05d856f..4f2b07b 100644
--- a/src/frdp-display.c
+++ b/src/frdp-display.c
@@ -261,8 +261,6 @@ frdp_display_open_host_cb (GObject      *source_object,
     g_signal_emit (self, signals[RDP_DISCONNECTED], 0);
 
     g_debug ("Connection failed");
-
-    frdp_display_close (self);
   }
 }
 
diff --git a/src/frdp-session.c b/src/frdp-session.c
index ca53d89..971f8b5 100644
--- a/src/frdp-session.c
+++ b/src/frdp-session.c
@@ -606,7 +606,6 @@ frdp_session_connect_thread (GTask        *task,
             break;
     }
 
-    freerdp_free (self->priv->freerdp_session);
     g_idle_add ((GSourceFunc) idle_close, self);
     g_task_return_boolean (task, FALSE);
 
@@ -708,7 +707,8 @@ frdp_session_finalize (GObject *object)
     g_clear_pointer (&self->priv->freerdp_session, freerdp_free);
   }
 
-  frdp_session_close (self);
+  if (frdp_session_is_open (self))
+    frdp_session_close (self);
 
   g_clear_pointer (&self->priv->hostname, g_free);
   g_clear_pointer (&self->priv->username, g_free);


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