aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2022-09-03 21:20:57 +0530
committerJussi Pakkanen <jpakkane@gmail.com>2022-09-03 20:12:35 +0300
commitf70895a4415d5120582785ad2a514d41d4d0701e (patch)
tree0ef33ea3460b47cb982ced6217e6529e7d57d279 /test cases
parentcc1dd6c1dda522894133f429d69f17c37045afba (diff)
downloadmeson-f70895a4415d5120582785ad2a514d41d4d0701e.zip
meson-f70895a4415d5120582785ad2a514d41d4d0701e.tar.gz
meson-f70895a4415d5120582785ad2a514d41d4d0701e.tar.bz2
tests/7 gnome: Fix incorrect unref of GResource
The returned GResource is transfer-none, since the generated function basically calls g_static_resource_get_resource(). It should not be unreffed. Causes an abort on Debian: GLib-GIO:ERROR:../../../gio/gresource.c:1451:g_static_resource_fini: assertion failed: (g_atomic_int_get (&resource->ref_count) >= 2)
Diffstat (limited to 'test cases')
-rw-r--r--test cases/frameworks/7 gnome/resources/generated-main.c3
-rw-r--r--test cases/frameworks/7 gnome/resources/simple-main.c4
2 files changed, 3 insertions, 4 deletions
diff --git a/test cases/frameworks/7 gnome/resources/generated-main.c b/test cases/frameworks/7 gnome/resources/generated-main.c
index fc9efbd..d102604 100644
--- a/test cases/frameworks/7 gnome/resources/generated-main.c
+++ b/test cases/frameworks/7 gnome/resources/generated-main.c
@@ -6,7 +6,7 @@
#define EXPECTED "This is a generated resource.\n"
int main(int argc, char **argv) {
- GResource *res = generated_resources_get_resource();
+ generated_resources_get_resource();
GError *err = NULL;
GBytes *data = g_resources_lookup_data("/com/example/myprog/res3.txt",
G_RESOURCE_LOOKUP_FLAGS_NONE, &err);
@@ -22,6 +22,5 @@ int main(int argc, char **argv) {
}
fprintf(stdout, "All ok.\n");
g_bytes_unref(data);
- g_resource_unref(res);
return 0;
}
diff --git a/test cases/frameworks/7 gnome/resources/simple-main.c b/test cases/frameworks/7 gnome/resources/simple-main.c
index 3569901..c021a54 100644
--- a/test cases/frameworks/7 gnome/resources/simple-main.c
+++ b/test cases/frameworks/7 gnome/resources/simple-main.c
@@ -6,7 +6,8 @@
#define EXPECTED "This is a resource.\n"
int main(int argc, char **argv) {
- GResource *res = simple_resources_get_resource();
+ simple_resources_get_resource();
+
GError *err = NULL;
GBytes *data = g_resources_lookup_data("/com/example/myprog/res1.txt",
G_RESOURCE_LOOKUP_FLAGS_NONE, &err);
@@ -22,6 +23,5 @@ int main(int argc, char **argv) {
}
fprintf(stdout, "All ok.\n");
g_bytes_unref(data);
- g_resource_unref(res);
return 0;
}