725d7e6ceb
Returning anything else but NULL would suggest the caller's reference might still be valid, but it isn't, because the caller just invoked _unref() after all. This turns the return value into a typesafe shortcut that allows unreffing and resetting a reference in one line. In contrast to solutions for this which take a pointer to a pointer to accomplish the same this solution is just syntactic sugar the developer can make use of but doesn't have to, and this is particularly useful when immediately unreffing objects returned by function calls. |
||
---|---|---|
.. | ||
.gitignore | ||
libudev-device-private.c | ||
libudev-device.c | ||
libudev-enumerate.c | ||
libudev-hwdb-def.h | ||
libudev-hwdb.c | ||
libudev-list.c | ||
libudev-monitor.c | ||
libudev-private.h | ||
libudev-queue-private.c | ||
libudev-queue.c | ||
libudev-util.c | ||
libudev.c | ||
libudev.h | ||
libudev.pc.in | ||
libudev.sym | ||
Makefile |