add some freeing and unrefing of glib variables and objects