DEFINE_TYPE_INSTANCE(Object);
-#ifdef I2_DEBUG
+#ifdef I2_LEAK_DEBUG
static boost::mutex l_ObjectCountLock;
static std::map<String, int> l_ObjectCounts;
static Timer::Ptr l_ObjectCountTimer;
-#endif
+#endif /* I2_LEAK_DEBUG */
/**
* Default constructor for the Object class.
return Object::TypeInstance;
}
-#ifdef I2_DEBUG
+#ifdef I2_LEAK_DEBUG
void icinga::TypeAddObject(Object *object)
{
boost::mutex::scoped_lock lock(l_ObjectCountLock);
}
INITIALIZE_ONCE(StartTypeInfoTimer);
-#endif /* I2_DEBUG */
+#endif /* I2_LEAK_DEBUG */
inline void intrusive_ptr_add_ref(Object *object)
{
-#ifdef I2_DEBUG
+#ifdef I2_LEAK_DEBUG
if (object->m_References == 0)
TypeAddObject(object);
-#endif /* I2_DEBUG */
+#endif /* I2_LEAK_DEBUG */
#ifdef _WIN32
InterlockedIncrement(&object->m_References);
ASSERT(refs >= 0);
if (refs == 0) {
-#ifdef I2_DEBUG
+#ifdef I2_LEAK_DEBUG
TypeRemoveObject(object);
-#endif /* I2_DEBUG */
+#endif /* I2_LEAK_DEBUG */
delete object;
}