tls-interaction test: use a weak pointer instead of a deliberate use-after-free

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666115
Reviewed-by: Dan Winship <danw@gnome.org>
This commit is contained in:
Simon McVittie 2011-12-13 18:18:27 +00:00
parent 0a7930d048
commit a1bd6e0717

View File

@ -384,10 +384,15 @@ static void
teardown_without_loop (Test *test,
gconstpointer unused)
{
gpointer weak_pointer = test->interaction;
g_object_add_weak_pointer (weak_pointer, &weak_pointer);
g_object_unref (test->password);
g_object_unref (test->interaction);
g_assert (!G_IS_OBJECT (test->interaction));
g_assert (weak_pointer == NULL);
}