Commit c04b7838 authored by Alexey.Musinov's avatar Alexey.Musinov Committed by Alexander Trofimov

refactoring

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@59881 954022d7-b5bf-4e40-9824-e11837661b57
parent db1692b5
This diff is collapsed.
#ifndef _BUILD_IRENDERER_H_ #ifndef _BUILD_IRENDERER_H_
#define _BUILD_IRENDERER_H_ #define _BUILD_IRENDERER_H_
#pragma once #pragma once
...@@ -7,33 +7,57 @@ ...@@ -7,33 +7,57 @@
#include "Matrix.h" #include "Matrix.h"
#include <string> #include <string>
#include <libkern/OSAtomic.h>
class IGrObject class IGrObject
{ {
protected: protected:
ULONG m_lRef;
#ifdef __APPLE__
volatile int32_t m_lRef;
#else
ULONG m_lRef;
#endif
public: public:
IGrObject() IGrObject()
{ {
m_lRef = 1; m_lRef = 1;
} }
virtual ~IGrObject() virtual ~IGrObject()
{ {
} }
virtual ULONG AddRef() #ifdef __APPLE__
{ virtual ULONG AddRef()
++m_lRef; {
return m_lRef; OSAtomicIncrement32(&m_lRef);
} return (ULONG)m_lRef;
}
virtual ULONG Release() virtual ULONG Release()
{ {
ULONG ret = --m_lRef; int32_t ret = OSAtomicDecrement32(&m_lRef);
if (0 == m_lRef) if (0 == m_lRef)
delete this; delete this;
return ret;
} return (ULONG)ret;
}
#else
virtual ULONG AddRef()
{
++m_lRef;
return m_lRef;
}
virtual ULONG Release()
{
ULONG ret = --m_lRef;
if (0 == m_lRef)
delete this;
return ret;
}
#endif
}; };
// тип в DrawPath // тип в DrawPath
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment