3 May
2011
3 May
'11
8:27 a.m.
2011/5/3 Rico Schüller <kgbricola(a)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.