this way it even compiles

#blame me if i did something wrong, i didn't test it ;)
This commit is contained in:
Harald Radi 2002-05-20 15:38:19 +00:00
parent e47a667cc9
commit 02a13a4ec4
2 changed files with 15 additions and 15 deletions

View file

@ -41,32 +41,32 @@ volatile LONG TPHPClassFactory::object_count = 0;
TPHPClassFactory::TPHPClassFactory()
{
m_refcount = 1;
InterlockedIncrement(&factory_count);
InterlockedIncrement(const_cast<long*> (&factory_count));
}
TPHPClassFactory::~TPHPClassFactory()
{
InterlockedDecrement(&factory_count);
InterlockedDecrement(const_cast<long*> (&factory_count));
}
void TPHPClassFactory::AddToObjectCount(void)
{
InterlockedIncrement(&object_count);
InterlockedIncrement(const_cast<long*> (&object_count));
}
void TPHPClassFactory::RemoveFromObjectCount(void)
{
InterlockedDecrement(&object_count);
InterlockedDecrement(const_cast<long*> (&object_count));
}
STDMETHODIMP_(DWORD) TPHPClassFactory::AddRef(void)
{
return InterlockedIncrement(&m_refcount);
return InterlockedIncrement(const_cast<long*> (&m_refcount));
}
STDMETHODIMP_(DWORD) TPHPClassFactory::Release(void)
{
DWORD ret = InterlockedDecrement(&m_refcount);
DWORD ret = InterlockedDecrement(const_cast<long*> (&m_refcount));
if (ret == 0)
delete this;
return ret;