[PATCH 2/6] Fix a memory leak by freeing the private null cursor



---
 src/vncdisplay.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/vncdisplay.c b/src/vncdisplay.c
index dc328ed..d20e695 100644
--- a/src/vncdisplay.c
+++ b/src/vncdisplay.c
@@ -986,7 +986,8 @@ static gboolean do_resize(void *opaque, int width, int height, gboolean quiet)
 	}
 
 	if (priv->gc == NULL) {
-		priv->null_cursor = create_null_cursor();
+		if (!priv->null_cursor)
+			priv->null_cursor = create_null_cursor();
 		if (priv->local_pointer)
 			do_pointer_show(obj);
 		else if (priv->in_pointer_grab || priv->absolute)
@@ -1621,6 +1622,11 @@ static void vnc_display_finalize (GObject *obj)
 		priv->image = NULL;
 	}
 
+	if (priv->null_cursor) {
+		gdk_cursor_unref (priv->null_cursor);
+		priv->null_cursor = NULL;
+	}
+
 	g_free (priv->host);
 	g_free (priv->port);
 
-- 
1.6.3.3


--=-ZGLsREbMdlUqAwJTGqis
Content-Disposition: attachment; filename*0=0003-Fix-a-memory-leak-by-freeing-the-result-of-gdk_pixbu.pat; filename*1=ch
Content-Type: text/x-patch; name="0003-Fix-a-memory-leak-by-freeing-the-result-of-gdk_pixbu.patch"; charset="UTF-8"
Content-Transfer-Encoding: 7bit



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