James Hawkins wrote:

Changelog:
* Remove redundant NULL checks before x_Release.

obj->Release() will read the vtable pointer from the object, and that will crash if obj is NULL, so these checks are needed. The following code will crash:

IUnknown *obj = NULL;
IUnknown_Release(obj);

You can see this looking at the definition of the IUnknown_Release macro:

include/unknwn.h:#define IUnknown_Release(p) (p)->lpVtbl->Release(p)

Mike


Reply via email to