Replaced all calls to malloc, calloc and free by their respective glib versions
Merge branch 'master' into eventLoops