Submitted by Debarshi Ray
We should use g_auto* instead of manually freeing resources: https://developer.gnome.org/glib/stable/glib-Miscellaneous-Macros.html#g-auto
Please don't put more than a single class in a single patch. It might be better to split bigger classes into multiple patches, but not more than one class per patch. Use your judgement.