[gnome-keyring] More reliable means of checking if object was finalized
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-keyring] More reliable means of checking if object was finalized
- Date: Sat, 17 Aug 2013 08:28:55 +0000 (UTC)
commit 1533e463d4263d3b4ec65750fb2f2ac7203edf73
Author: Stef Walter <stefw gnome org>
Date: Thu Aug 15 10:17:17 2013 +0200
More reliable means of checking if object was finalized
Don't try to use G_IS_OBJECT() to see if an object was finalized
as this segfaults in corner cases, even with our crafty check
for a pointer within our memory space.
pkcs11/gnome2-store/tests/test-gnome2-storage.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/pkcs11/gnome2-store/tests/test-gnome2-storage.c b/pkcs11/gnome2-store/tests/test-gnome2-storage.c
index fefe476..e9041c4 100644
--- a/pkcs11/gnome2-store/tests/test-gnome2-storage.c
+++ b/pkcs11/gnome2-store/tests/test-gnome2-storage.c
@@ -89,6 +89,7 @@ setup_module (Test *test,
test->storage = gkm_gnome2_storage_new (test->module, test->directory);
rv = gkm_gnome2_storage_refresh (test->storage);
gkm_assert_cmprv (rv, ==, CKR_OK);
+ g_object_add_weak_pointer (G_OBJECT (test->storage), (gpointer *)&test->storage);
/* We already have the CKA_LABEL attribute */
gkm_store_register_schema (GKM_STORE (test->storage), &url, NULL, 0);
@@ -151,7 +152,7 @@ teardown_module (Test *test,
g_object_unref (test->new_object);
g_object_unref (test->old_object);
g_object_unref (test->storage);
- g_assert (!G_IS_OBJECT (test->storage));
+ g_assert (test->storage == NULL);
mock_gnome2_module_leave_and_finalize ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]