in reply to Re^2: Glib Errors on close
in thread Glib Errors on close

An "attempt to free unreferenced scalar" basically means the perl interpreter got confused somewhere about the reference count of some object. This usually indicates a serious issue with either the interpreter itself or some of the XS/C based extensions you're using.

Given that you're using threads, it really could be either, but I would probably start by not using threads and see if the problem goes away. There really aren't many situations where threads are the best option (at least, not in perl).