[librest/wip/teuf/gtask: 26/28] tests/oauth-async: Fix mainloop leaks



commit 5807378643e7a590e05c367ce49ede6f0e893c91
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Mon Jun 20 12:10:40 2016 +0200

    tests/oauth-async: Fix mainloop leaks
    
    This fixes:
    
    ==16369== 16 bytes in 1 blocks are definitely lost in loss record 885 of 3,291
    ==16369==    at 0x4C2DA60: calloc (vg_replace_malloc.c:711)
    ==16369==    by 0x5F5CEB0: g_malloc0 (gmem.c:124)
    ==16369==    by 0x5F57BF1: g_main_loop_new (gmain.c:3929)
    ==16369==    by 0x401B13: test_request_token (oauth-async.c:183)
    ==16369==    by 0x5F7C983: test_case_run (gtestutils.c:2158)
    ==16369==    by 0x5F7C983: g_test_run_suite_internal (gtestutils.c:2241)
    ==16369==    by 0x5F7CB4E: g_test_run_suite_internal (gtestutils.c:2253)
    ==16369==    by 0x5F7CD5D: g_test_run_suite (gtestutils.c:2328)
    ==16369==    by 0x5F7CD80: g_test_run (gtestutils.c:1596)
    ==16369==    by 0x401D1C: main (oauth-async.c:237)
    ==16369==
    ==16369== 16 bytes in 1 blocks are definitely lost in loss record 886 of 3,291
    ==16369==    at 0x4C2DA60: calloc (vg_replace_malloc.c:711)
    ==16369==    by 0x5F5CEB0: g_malloc0 (gmem.c:124)
    ==16369==    by 0x5F57BF1: g_main_loop_new (gmain.c:3929)
    ==16369==    by 0x401BA9: test_access_token (oauth-async.c:199)
    ==16369==    by 0x5F7C983: test_case_run (gtestutils.c:2158)
    ==16369==    by 0x5F7C983: g_test_run_suite_internal (gtestutils.c:2241)
    ==16369==    by 0x5F7CB4E: g_test_run_suite_internal (gtestutils.c:2253)
    ==16369==    by 0x5F7CD5D: g_test_run_suite (gtestutils.c:2328)
    ==16369==    by 0x5F7CD80: g_test_run (gtestutils.c:1596)
    ==16369==    by 0x401D1C: main (oauth-async.c:237)
    ==16369==
    ==16369== 16 bytes in 1 blocks are definitely lost in loss record 887 of 3,291
    ==16369==    at 0x4C2DA60: calloc (vg_replace_malloc.c:711)
    ==16369==    by 0x5F5CEB0: g_malloc0 (gmem.c:124)
    ==16369==    by 0x5F57BF1: g_main_loop_new (gmain.c:3929)
    ==16369==    by 0x401C3F: test_calls (oauth-async.c:215)
    ==16369==    by 0x5F7C983: test_case_run (gtestutils.c:2158)
    ==16369==    by 0x5F7C983: g_test_run_suite_internal (gtestutils.c:2241)
    ==16369==    by 0x5F7CB4E: g_test_run_suite_internal (gtestutils.c:2253)
    ==16369==    by 0x5F7CD5D: g_test_run_suite (gtestutils.c:2328)
    ==16369==    by 0x5F7CD80: g_test_run (gtestutils.c:1596)
    ==16369==    by 0x401D1C: main (oauth-async.c:237)

 tests/oauth-async.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/tests/oauth-async.c b/tests/oauth-async.c
index 6f696d0..65e626a 100644
--- a/tests/oauth-async.c
+++ b/tests/oauth-async.c
@@ -191,6 +191,7 @@ test_request_token ()
                                    NULL, request_token_cb1, loop);
 
   g_main_loop_run (loop);
+  g_main_loop_unref (loop);
 }
 
 static void
@@ -207,6 +208,7 @@ test_access_token ()
                                    NULL, request_token_cb2, loop);
 
   g_main_loop_run (loop);
+  g_main_loop_unref (loop);
 }
 
 static void
@@ -223,6 +225,7 @@ test_calls ()
                                    NULL, request_token_cb3, loop);
 
   g_main_loop_run (loop);
+  g_main_loop_unref (loop);
 }
 
 int


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