[uim-commit] r2700 - trunk/xim
ekato at freedesktop.org
ekato at freedesktop.org
Sat Dec 24 22:38:51 PST 2005
Author: ekato
Date: 2005-12-24 22:38:07 -0800 (Sat, 24 Dec 2005)
New Revision: 2700
Modified:
trunk/xim/main.cpp
Log:
* xim/main.cpp (main_loop) : Add comment and safety check (but
this shouldn't happen).
Modified: trunk/xim/main.cpp
===================================================================
--- trunk/xim/main.cpp 2005-12-24 04:58:23 UTC (rev 2699)
+++ trunk/xim/main.cpp 2005-12-25 06:38:07 UTC (rev 2700)
@@ -172,7 +172,13 @@
it->second.fn(fd, READ_OK);
if (FD_ISSET(fd, &wfds))
it->second.fn(fd, WRITE_OK);
+ // fd_watch_stat may be modified by above functions at
+ // this point. Since the behavior with incrementing
+ // invalidated iterator is compiler dependent, use safer
+ // way.
it = fd_watch_stat.find(fd);
+ if (it == fd_watch_stat.end()) // shouldn't happen
+ break;
it++;
}
}
More information about the uim-commit
mailing list