mirror of https://github.com/axmolengine/axmol.git
issue #26: because it use some macro that using malloc and free, so we can not change it to new
This commit is contained in:
parent
f236e4d542
commit
8c754ee5a9
|
@ -202,7 +202,7 @@ void CCScheduler::scheduleSelector(SEL_SCHEDULE pfnSelector, SelectorProtocol *p
|
|||
|
||||
if (! pElement)
|
||||
{
|
||||
pElement = new tHashSelectorEntry;
|
||||
pElement = (tHashSelectorEntry *)calloc(sizeof(*pElement), 1);;
|
||||
pElement->target = pTarget;
|
||||
HASH_ADD_INT(m_pHashForSelectors, target, pElement);
|
||||
|
||||
|
@ -287,7 +287,7 @@ void CCScheduler::unscheduleSelector(SEL_SCHEDULE pfnSelector, SelectorProtocol
|
|||
|
||||
void CCScheduler::priorityIn(tListEntry **ppList, SelectorProtocol *pTarget, int nPriority, bool bPaused)
|
||||
{
|
||||
tListEntry *pListElement = new tListEntry;
|
||||
tListEntry *pListElement = (tListEntry *)malloc(sizeof(*pListElement));
|
||||
|
||||
pListElement->target = pTarget;
|
||||
pListElement->priority = nPriority;
|
||||
|
@ -334,7 +334,7 @@ void CCScheduler::priorityIn(tListEntry **ppList, SelectorProtocol *pTarget, int
|
|||
}
|
||||
|
||||
// update hash entry for quick access
|
||||
tHashUpdateEntry *pHashElement = new tHashUpdateEntry();
|
||||
tHashUpdateEntry *pHashElement = (tHashUpdateEntry *)calloc(sizeof(*pHashElement), 1);
|
||||
pHashElement->target = pTarget;
|
||||
pHashElement->list = ppList;
|
||||
pHashElement->entry = pListElement;
|
||||
|
@ -343,7 +343,8 @@ void CCScheduler::priorityIn(tListEntry **ppList, SelectorProtocol *pTarget, int
|
|||
|
||||
void CCScheduler::appendIn(_listEntry **ppList, SelectorProtocol *pTarget, bool bPaused)
|
||||
{
|
||||
tListEntry *pListElement = new tListEntry;
|
||||
tListEntry *pListElement = (tListEntry *)malloc(sizeof(*pListElement));
|
||||
;
|
||||
|
||||
pListElement->target = pTarget;
|
||||
pListElement->paused = bPaused;
|
||||
|
|
Loading…
Reference in New Issue