From 8d874512b6a1520dc9fbbe6322495e9e2da9dc3c Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 27 May 2013 11:57:28 -0700 Subject: No-op if DELETE_OBJ is given a NULL pointer --- OpenAL32/Include/alMain.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'OpenAL32') 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) -- cgit v1.2.3