paragui-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paragui-cvs] CVS: paragui/src/core pgtimerobject.cpp,1.1.2.4,1.1.2.5


From: Alexander Pipelka <address@hidden>
Subject: [paragui-cvs] CVS: paragui/src/core pgtimerobject.cpp,1.1.2.4,1.1.2.5
Date: Wed, 03 Jul 2002 14:28:04 -0400

Update of /cvsroot/paragui/paragui/src/core
In directory subversions:/tmp/cvs-serv17766/src/core

Modified Files:
      Tag: devel-1-0
        pgtimerobject.cpp 
Log Message:
fixed the famous "loop through an iterator and erases elements" bug.
added proper include dir for sample apps.



Index: pgtimerobject.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/core/Attic/pgtimerobject.cpp,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -r1.1.2.4 -r1.1.2.5
*** pgtimerobject.cpp   29 May 2002 13:52:22 -0000      1.1.2.4
--- pgtimerobject.cpp   3 Jul 2002 18:28:02 -0000       1.1.2.5
***************
*** 22,27 ****
        std::map<PG_TimerID, SDL_TimerID>::iterator i;
        
!       for(i = my_timermap.begin(); i != my_timermap.end(); i++) {
                RemoveTimer((*i).first);
        }
        
--- 22,28 ----
        std::map<PG_TimerID, SDL_TimerID>::iterator i;
        
!       for(i = my_timermap.begin(); i != my_timermap.end(); ) {
                RemoveTimer((*i).first);
+               i = my_timermap.begin();
        }
        
***************
*** 48,55 ****
        
  bool PG_TimerObject::RemoveTimer(PG_TimerID id) {
-       if(my_timermap[id] == 0) {
-               return false;
-       }
-       
        SDL_TimerID sid = my_timermap[id];
        my_timermap.erase(id);
--- 49,52 ----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]