mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
44388987cf
--HG-- rename : media/gmp-clearkey/0.1/ClearKeyDecryptionManager.cpp => media/gmp-clearkey/0.1/ClearKeySessionManager.cpp
35 lines
614 B
C++
35 lines
614 B
C++
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#ifndef __RefCount_h__
|
|
#define __RefCount_h__
|
|
|
|
// Note: Not thread safe!
|
|
class RefCounted {
|
|
public:
|
|
void AddRef() {
|
|
++mRefCount;
|
|
}
|
|
|
|
uint32_t Release() {
|
|
uint32_t newCount = --mRefCount;
|
|
if (!newCount) {
|
|
delete this;
|
|
}
|
|
return newCount;
|
|
}
|
|
|
|
protected:
|
|
RefCounted()
|
|
: mRefCount(0)
|
|
{
|
|
}
|
|
virtual ~RefCounted()
|
|
{
|
|
}
|
|
uint32_t mRefCount;
|
|
};
|
|
|
|
#endif // __RefCount_h__
|