On 05/16/2018 03:56 PM, Kevin Wolf wrote:

+
+void job_unref(Job *job)
+{
+    if (--job->refcnt == 0) {

Should this be free()-like and allow an incoming job == NULL as a no-op?

This behaves like block_job_unref() always behavec, and I don't see a
single caller having a NULL check before calling job_unref(), so is it
worth it?

Only if it makes it easier to clean up a partially-constructed object (which is the most likely case of wanting to pass in NULL)

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Reply via email to