Commit 285eeb3d authored by Mihai Moldovan's avatar Mihai Moldovan
Browse files

src/x2goclient-network-ssh.c: re-order finalization.

Destruction is a delicate matter and we actually have things depend on
each other now, so make sure that we get rid of data in the correct
order, which also means destroying properties last.
parent 27f6fa5d
......@@ -212,6 +212,21 @@ static void x2goclient_network_ssh_dispose (GObject * const object) {
static void x2goclient_network_ssh_finalize (GObject * const object) {
X2GoClientNetworkSSH *self = X2GOCLIENT_NETWORK_SSH (object);
/*
* The order of finalization is pretty important.
*
* We'll need data such as the session path for termination of the master
* connection, so make sure that the dependencies are set up correctly here.
*/
if (!(x2goclient_network_ssh_kill_subprocesses (self))) {
g_log (NULL, G_LOG_LEVEL_CRITICAL, "Some subprocesses were not terminated correctly!");
}
g_free (self->control_path);
self->control_path = NULL;
/* Properties. */
if (self->openssh_version) {
g_boxed_free (X2GOCLIENT_TYPE_OPENSSH_VERSION, self->openssh_version);
......@@ -223,14 +238,6 @@ static void x2goclient_network_ssh_finalize (GObject * const object) {
self->openssh_bugs = NULL;
}
g_free (self->control_path);
self->control_path = NULL;
if (!(x2goclient_network_ssh_kill_subprocesses (self))) {
g_log (NULL, G_LOG_LEVEL_CRITICAL, "Some subprocesses were not terminated correctly!");
}
(G_OBJECT_CLASS (x2goclient_network_ssh_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