[PATCH 3/4] d3dx9: Implement ID3DXBaseEffect::GetPixelShader().

Henri Verbeet hverbeet at gmail.com
Tue May 3 08:27:24 CDT 2011


2011/5/3 Rico Schüller <kgbricola at web.de>:
> +#define SAFE_ADDREF(x) if(x) IUnknown_AddRef(x)
> +#define SAFE_RELEASE(x) if(x) IUnknown_Release(x)
That's not so safe, actually. Consider e.g. what happens when "x" has
side effects, or when you write something like "if (cond)
SAFE_ADDREF(x); else return;". If you really want this an inline
function should do just as well, but for the handful of uses I see in
this series it just obfuscates the code.



More information about the wine-devel mailing list