]> source.dussan.org Git - tigervnc.git/commitdiff
[Bugfix] Don't operate on erased iterator (ID 3112731).
authorAdam Tkac <atkac@redhat.com>
Mon, 22 Nov 2010 14:53:23 +0000 (14:53 +0000)
committerAdam Tkac <atkac@redhat.com>
Mon, 22 Nov 2010 14:53:23 +0000 (14:53 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4204 3789f03b-4d11-0410-bbf8-ca57d06f2519

common/rfb/ScreenSet.h

index 6f5188ca23b0f506d7bee239dd30fdfbf56edb56..f2df156cc13dab26c29f5b16eeccb9b605b1c1f3 100644 (file)
@@ -74,8 +74,9 @@ namespace rfb {
 
     inline void add_screen(const Screen screen) { screens.push_back(screen); };
     inline void remove_screen(rdr::U32 id) {
-      std::list<Screen>::iterator iter;
-      for (iter = screens.begin();iter != screens.end();++iter) {
+      std::list<Screen>::iterator iter, nextiter;
+      for (iter = screens.begin();iter != screens.end();iter = nextiter) {
+        nextiter = ++iter;
         if (iter->id == id)
             screens.erase(iter);
       }