Skip to content

Commit

Permalink
dont modify the map during iteration loop
Browse files Browse the repository at this point in the history
  • Loading branch information
jakedouglas committed Sep 24, 2009
1 parent 083ead4 commit 1f53af8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ext/em.cpp
Expand Up @@ -132,8 +132,10 @@ EventMachine_t::~EventMachine_t()
close (LoopBreakerWriter);

// Remove any file watch descriptors
for(map<int, Bindable_t*>::iterator f=Files.begin(); f != Files.end(); f++)
while(!Files.empty()) {
map<int, Bindable_t*>::iterator f = Files.begin();
UnwatchFile (f->first);
}

if (epfd != -1)
close (epfd);
Expand Down

0 comments on commit 1f53af8

Please sign in to comment.