[wpdev-commits] wolfpack timers.cpp,1.12,1.13
Brought to you by:
rip,
thiagocorrea
From: Jorge P. <ke...@us...> - 2004-08-25 18:46:35
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2288 Modified Files: timers.cpp Log Message: Fixed a crash in removing timers (apparently Linux only) Index: timers.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/timers.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** timers.cpp 25 Aug 2004 17:01:23 -0000 1.12 --- timers.cpp 25 Aug 2004 18:46:15 -0000 1.13 *************** *** 239,250 **** { cTimer* tEffect = NULL; - if ( !teffects.empty() ) - tEffect = *teffects.begin(); - - if ( !tEffect ) - return; ! while ( tEffect && tEffect->expiretime <= Server::instance()->time() ) { if ( isCharSerial( tEffect->getDest() ) ) { --- 239,249 ---- { cTimer* tEffect = NULL; ! while ( !teffects.empty() ) { + tEffect = *teffects.begin(); + if ( !tEffect || tEffect->expiretime > Server::instance()->time() ) + break; + if ( isCharSerial( tEffect->getDest() ) ) { *************** *** 257,268 **** tEffect->Expire(); - std::pop_heap( teffects.begin(), teffects.end(), cTimers::ComparePredicate() ); - teffects.pop_back(); - delete tEffect; ! if ( !teffects.empty() ) ! tEffect = *teffects.begin(); ! else ! break; } } --- 256,263 ---- tEffect->Expire(); ! erase( tEffect ); ! ! delete tEffect; } } |