22 lines
509 B
C
22 lines
509 B
C
#ifndef COM_H__
|
|
#define COM_H__
|
|
|
|
#include "log/NLog.h"
|
|
|
|
#define PPCAT_NX(A, B) A ## B
|
|
#define PPCAT(A, B) PPCAT_NX(A, B)
|
|
|
|
#define SAFE_RELEASE(__PTR___) \
|
|
if(__PTR___ != nullptr)\
|
|
(__PTR___)->Release(); \
|
|
|
|
|
|
#define FINAL_RELEASE(__PTR___) \
|
|
if(__PTR___ != nullptr) {\
|
|
auto __PTR___##release_return_val = (__PTR___)->Release(); \
|
|
if(__PTR___##release_return_val != 0) {\
|
|
LogInfo() << PPCAT("Final release failed on object ", #__PTR___) << " Refcount now = " << __PTR___##release_return_val; \
|
|
}}
|
|
|
|
|
|
#endif |