Files
LifeProject/LifeCore/Com.h
T

22 lines
509 B
C
Raw Normal View History

2025-05-13 02:46:21 +03:00
#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