diff options
author | Adam Tkac <atkac@redhat.com> | 2010-11-22 14:53:23 +0000 |
---|---|---|
committer | Adam Tkac <atkac@redhat.com> | 2010-11-22 14:53:23 +0000 |
commit | 684ca1df03763135bd2cf90b07b77517e57f12f3 (patch) | |
tree | f31ec685029ab8f7fbb66871fb4cffd39a9f3ce2 | |
parent | 6a7b09f440fc76ef9109167979fc472dfc4c5e18 (diff) | |
download | tigervnc-684ca1df03763135bd2cf90b07b77517e57f12f3.tar.gz tigervnc-684ca1df03763135bd2cf90b07b77517e57f12f3.zip |
[Bugfix] Don't operate on erased iterator (ID 3112731).
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4204 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r-- | common/rfb/ScreenSet.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/common/rfb/ScreenSet.h b/common/rfb/ScreenSet.h index 6f5188ca..f2df156c 100644 --- a/common/rfb/ScreenSet.h +++ b/common/rfb/ScreenSet.h @@ -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); } |