[gtk-vnc] Fix some misc warnings & mem leak in test case



commit bc9d02dd33482e1d7f9429b490a50de47a90407e
Author: Daniel P. Berrange <berrange redhat com>
Date:   Wed Feb 8 12:35:55 2017 +0000

    Fix some misc warnings & mem leak in test case
    
    Signed-off-by: Daniel P. Berrange <berrange redhat com>

 src/vncconnectiontest.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/vncconnectiontest.c b/src/vncconnectiontest.c
index 4917b2f..6a5e49c 100644
--- a/src/vncconnectiontest.c
+++ b/src/vncconnectiontest.c
@@ -42,7 +42,7 @@ struct GVncTest {
     gboolean quit;
     char *error;
 
-    char *pixels;
+    guint8 *pixels;
 
     void (*test_func)(GInputStream *, GOutputStream *);
 };
@@ -155,6 +155,8 @@ static gpointer test_helper_server(gpointer opaque)
     }
 
     g_object_unref(client);
+
+    return NULL;
 }
 
 static void test_helper_desktop_resize(VncConnection *conn,
@@ -182,7 +184,7 @@ static void test_helper_desktop_resize(VncConnection *conn,
     remoteFormat = vnc_connection_get_pixel_format(conn);
 
     /* We'll fix our local copy as rgb888 */
-    test->pixels = g_new0(char, width * height * 4);
+    test->pixels = g_new0(guint8, width * height * 4);
 
     fb = vnc_base_framebuffer_new(test->pixels, width, height, width * 4,
                                   remoteFormat,
@@ -519,7 +521,6 @@ static void test_validation(void (*test_func)(GInputStream *, GOutputStream *))
 {
     struct GVncTest *test;
     char *port;
-    GMainLoop *loop;
     GThread *th;
 
     test = g_new0(struct GVncTest, 1);
@@ -530,8 +531,6 @@ static void test_validation(void (*test_func)(GInputStream *, GOutputStream *))
     g_cond_init(&test->cond);
     g_mutex_lock(&test->lock);
 
-    loop = g_main_loop_new(g_main_context_default(), FALSE);
-
     th = g_thread_new("rre-server", test_helper_server, test);
 
     g_mutex_lock(&test->lock);


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