Replace it by g_set_object() as it does the same thing.
Replace it by g_clear_object() as it does the same thing.