diff options
author | Stef Walter <stefw@gnome.org> | 2013-08-15 10:17:17 +0200 |
---|---|---|
committer | Stef Walter <stefw@gnome.org> | 2013-08-15 10:38:25 +0200 |
commit | 1533e463d4263d3b4ec65750fb2f2ac7203edf73 (patch) | |
tree | 56e74269badfa32034604d8d2e3dca009bdb00c3 | |
parent | 99b6f5aa5bf2d216fa4ad47a94cde21f87f1af38 (diff) |
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.
-rw-r--r-- | 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 fefe4761..e9041c4b 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 (); |