Browse Source

Prevent working with an invalid iterator (issue #331)

Bart van Strien 13 years ago
parent
commit
fafe472595
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/modules/audio/openal/Pool.cpp

+ 3 - 2
src/modules/audio/openal/Pool.cpp

@@ -92,9 +92,10 @@ namespace openal
 				i->first->rewindAtomic();
 				i->first->release();
 				available.push(i->second);
-				playing.erase(i);
+				playing.erase(i++);
 			}
-			i++;
+			else
+				i++;
 		}
 	}