Fix memory leak in example codes 28/101228/1 accepted/tizen/3.0/common/20161203.012055 accepted/tizen/3.0/ivi/20161202.005458 accepted/tizen/3.0/mobile/20161202.005402 accepted/tizen/3.0/tv/20161202.005416 accepted/tizen/3.0/wearable/20161202.005435 submit/tizen_3.0/20161201.021013
authorJiwoong Im <jiwoong.im@samsung.com>
Wed, 30 Nov 2016 12:05:03 +0000 (21:05 +0900)
committerJiwoong Im <jiwoong.im@samsung.com>
Wed, 30 Nov 2016 12:05:03 +0000 (21:05 +0900)
Change-Id: I460a67233e1069c3f906c461f716d1596404eea0
Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
example/get_async.c
example/set_async.c

index bd0ed80..89fc048 100644 (file)
@@ -150,6 +150,7 @@ int main(int argc, char *argv[])
        r = buxton_open(&cli, NULL, NULL);
        if (r) {
                perror("buxton_open");
+               g_main_loop_unref(loop);
                return EXIT_FAILURE;
        }
 
@@ -157,6 +158,7 @@ int main(int argc, char *argv[])
        if (!layer) {
                perror("buxton_create_layer");
                buxton_close(cli);
+               g_main_loop_unref(loop);
                return EXIT_FAILURE;
        }
        key = argv[2];
@@ -166,6 +168,7 @@ int main(int argc, char *argv[])
                perror("buxton_get_value");
                buxton_free_layer(layer);
                buxton_close(cli);
+               g_main_loop_unref(loop);
                return EXIT_FAILURE;
        }
 
index 6a93a8c..71f5043 100644 (file)
@@ -157,6 +157,7 @@ int main(int argc, char *argv[])
        r = buxton_open(&cli, NULL, NULL);
        if (r) {
                perror("buxton_open");
+               g_main_loop_unref(loop);
                return EXIT_FAILURE;
        }
 
@@ -164,6 +165,7 @@ int main(int argc, char *argv[])
        if (!layer) {
                perror("buxton_create_layer");
                buxton_close(cli);
+               g_main_loop_unref(loop);
                return EXIT_FAILURE;
        }
        key = argv[2];
@@ -175,6 +177,7 @@ int main(int argc, char *argv[])
        if (!val) {
                buxton_free_layer(layer);
                buxton_close(cli);
+               g_main_loop_unref(loop);
                return EXIT_FAILURE;
        }
 
@@ -183,6 +186,7 @@ int main(int argc, char *argv[])
                perror("buxton_set_value");
                buxton_free_layer(layer);
                buxton_close(cli);
+               g_main_loop_unref(loop);
                return EXIT_FAILURE;
        }
        buxton_value_free(val);