aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/Include
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2013-05-27 11:57:28 -0700
committerChris Robinson <[email protected]>2013-05-27 12:07:54 -0700
commit8d874512b6a1520dc9fbbe6322495e9e2da9dc3c (patch)
tree685b016d1e3c9ec4705894f504a580b7b26e0803 /OpenAL32/Include
parent9e84f38a46f49230bf836e8a33b0637c000d659b (diff)
No-op if DELETE_OBJ is given a NULL pointer
Diffstat (limited to 'OpenAL32/Include')
-rw-r--r--OpenAL32/Include/alMain.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index 16df2330..c0c7baac 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -74,13 +74,16 @@ static const union {
#define EXTRACT_VCALL_ARGS(...) __VA_ARGS__
/* Call a "virtual" method on an object, with arguments. */
-#define VCALL(obj, func, args) (((obj)->vtbl->func)((obj), EXTRACT_VCALL_ARGS args))
+#define VCALL(obj, func, args) ((obj)->vtbl->func((obj), EXTRACT_VCALL_ARGS args))
/* Call a "virtual" method on an object, with no arguments. */
-#define VCALL_NOARGS(obj, func) (((obj)->vtbl->func)((obj)))
+#define VCALL_NOARGS(obj, func) ((obj)->vtbl->func((obj)))
#define DELETE_OBJ(obj) do { \
- VCALL_NOARGS((obj),Destruct); \
- VCALL_NOARGS((obj),Delete); \
+ if((obj) != NULL) \
+ { \
+ VCALL_NOARGS((obj),Destruct); \
+ VCALL_NOARGS((obj),Delete); \
+ } \
} while(0)