081842bac6
This is based on `g_clear_object`, so it will be a bit more consistent to write (and prevents the headaches from accidentally forgetting a NULL check).