Re: testing that an object really has been destroyed in unittests



On Fri, 24 Sep 2004 19:22:52 +0200, Stefan Kost
<kost imn htwk-leipzig de> wrote:
hi hi,

has anyone an idea how I can verify that after a
  g_object_unref(myobj);
the object has been destroyed.
[...]

    You can use `g_object_weak_ref ()' to register a callback to be called
when the object is finalized.

You can not check if an object has been finalized after the fact for
the same reasons you can not check if a memory region has been
freed after freeing it.

Cheers,
                                                          -Tristan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]