mirror of https://github.com/axmolengine/axmol.git
trackRef and untrackRef are static function now.
This commit is contained in:
parent
54176b0267
commit
4c23ff5b8c
|
@ -35,8 +35,8 @@ THE SOFTWARE.
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
#if CC_USE_MEM_LEAK_DETECTION
|
#if CC_USE_MEM_LEAK_DETECTION
|
||||||
void trackRef(Ref* ref);
|
static void trackRef(Ref* ref);
|
||||||
void untrackRef(Ref* ref);
|
static void untrackRef(Ref* ref);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Ref::Ref()
|
Ref::Ref()
|
||||||
|
@ -168,15 +168,15 @@ void Ref::printLeaks()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void trackRef(Ref* ref)
|
static void trackRef(Ref* ref)
|
||||||
{
|
{
|
||||||
CC_ASSERT(ref);
|
CCASSERT(ref, "Invalid parameter, ref should not be null!");
|
||||||
|
|
||||||
// Create memory allocation record.
|
// Create memory allocation record.
|
||||||
__refAllocationList.push_back(ref);
|
__refAllocationList.push_back(ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
void untrackRef(Ref* ref)
|
static void untrackRef(Ref* ref)
|
||||||
{
|
{
|
||||||
auto iter = std::find(__refAllocationList.begin(), __refAllocationList.end(), ref);
|
auto iter = std::find(__refAllocationList.begin(), __refAllocationList.end(), ref);
|
||||||
if (iter == __refAllocationList.end())
|
if (iter == __refAllocationList.end())
|
||||||
|
|
Loading…
Reference in New Issue