mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
this way it even compiles
#blame me if i did something wrong, i didn't test it ;)
This commit is contained in:
parent
e47a667cc9
commit
02a13a4ec4
2 changed files with 15 additions and 15 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue