Monday, October 31, 2011

Insight into an GObject's lifetime.

My favourite Space Station

I just needed a quick way to get an overview over the lifetime of a specific instance of a Vala class.
Thus I need some informations about it's creation - and more important - it's destruction time.
robster pointed me to gobject-list a small library which is preloaded and tracks gobjects' _ref and _unref calls - so a great tool for vala code.

It's simple to get it up and running on Fedora:
$ sudo yum install libunwind-devel glib2-devel
$ git clone git://git.collabora.co.uk/git/user/danni/gobject-list.git
$ make
...
$ cd /path/to/myapp/
$ LD_PRELOAD=/path/to/libgobject-list.so myvalaapp | grep MyClass

More can be found in Danielle's initial post and more about vala's memory management can be found here.



No comments:

Post a Comment