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:
Ming 2010-08-04 03:10:55 +00:00
parent f236e4d542
commit 8c754ee5a9
1 changed files with 5 additions and 4 deletions

View File

@ -202,7 +202,7 @@ void CCScheduler::scheduleSelector(SEL_SCHEDULE pfnSelector, SelectorProtocol *p
if (! pElement) if (! pElement)
{ {
pElement = new tHashSelectorEntry; pElement = (tHashSelectorEntry *)calloc(sizeof(*pElement), 1);;
pElement->target = pTarget; pElement->target = pTarget;
HASH_ADD_INT(m_pHashForSelectors, target, pElement); 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) 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->target = pTarget;
pListElement->priority = nPriority; pListElement->priority = nPriority;
@ -334,7 +334,7 @@ void CCScheduler::priorityIn(tListEntry **ppList, SelectorProtocol *pTarget, int
} }
// update hash entry for quick access // update hash entry for quick access
tHashUpdateEntry *pHashElement = new tHashUpdateEntry(); tHashUpdateEntry *pHashElement = (tHashUpdateEntry *)calloc(sizeof(*pHashElement), 1);
pHashElement->target = pTarget; pHashElement->target = pTarget;
pHashElement->list = ppList; pHashElement->list = ppList;
pHashElement->entry = pListElement; pHashElement->entry = pListElement;
@ -343,7 +343,8 @@ void CCScheduler::priorityIn(tListEntry **ppList, SelectorProtocol *pTarget, int
void CCScheduler::appendIn(_listEntry **ppList, SelectorProtocol *pTarget, bool bPaused) void CCScheduler::appendIn(_listEntry **ppList, SelectorProtocol *pTarget, bool bPaused)
{ {
tListEntry *pListElement = new tListEntry; tListEntry *pListElement = (tListEntry *)malloc(sizeof(*pListElement));
;
pListElement->target = pTarget; pListElement->target = pTarget;
pListElement->paused = bPaused; pListElement->paused = bPaused;