shared: add code comment to nm_clear_g_object()

This commit is contained in:
Thomas Haller 2021-01-08 11:11:28 +01:00
parent 02f4b0cbd5
commit 123765befc
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -1038,6 +1038,14 @@ nm_g_object_unref(gpointer obj)
*/
#define nm_clear_g_free(pp) nm_clear_pointer(pp, g_free)
/* Our nm_clear_pointer() is more typesafe than g_clear_pointer() and
* should be preferred.
*
* For g_clear_object() that is not the case (because g_object_unref()
* anyway takes a void pointer). So using g_clear_object() is fine.
*
* Still have a nm_clear_g_object() because that returns a boolean
* indication whether anything was cleared. */
#define nm_clear_g_object(pp) nm_clear_pointer(pp, g_object_unref)
/**