From 1e6c7488bdc2a47641b83f1db8e5676e53fb4e8e Mon Sep 17 00:00:00 2001
From: George Kiagiadakis <george.kiagiadakis@collabora.com>
Date: Thu, 20 Jun 2019 18:55:50 +0300
Subject: [PATCH] proxy: avoid crashing when the WpProxy is unrefed in the
 "destroyed" signal handler

---
 lib/wp/proxy.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/wp/proxy.c b/lib/wp/proxy.c
index 025507ba..c5082f15 100644
--- a/lib/wp/proxy.c
+++ b/lib/wp/proxy.c
@@ -51,11 +51,11 @@ proxy_event_destroy (void *data)
 {
   WpProxyPrivate *self = wp_proxy_get_instance_private (WP_PROXY(data));
 
-  /* Emit the destroy signal */
-  g_signal_emit (data, wp_proxy_signals[SIGNAL_DESTROYED], 0);
-
   /* Set the proxy to NULL */
   self->proxy = NULL;
+
+  /* Emit the destroy signal */
+  g_signal_emit (data, wp_proxy_signals[SIGNAL_DESTROYED], 0);
 }
 
 static void
-- 
GitLab