Revision 0290b57b

b/vl.c
1249 1249
        IOHandlerRecord *pioh;
1250 1250

  
1251 1251
        QLIST_FOREACH_SAFE(ioh, &io_handlers, next, pioh) {
1252
            if (ioh->deleted) {
1253
                QLIST_REMOVE(ioh, next);
1254
                qemu_free(ioh);
1255
                continue;
1256
            }
1257
            if (ioh->fd_read && FD_ISSET(ioh->fd, &rfds)) {
1252
            if (!ioh->deleted && ioh->fd_read && FD_ISSET(ioh->fd, &rfds)) {
1258 1253
                ioh->fd_read(ioh->opaque);
1259 1254
            }
1260
            if (ioh->fd_write && FD_ISSET(ioh->fd, &wfds)) {
1255
            if (!ioh->deleted && ioh->fd_write && FD_ISSET(ioh->fd, &wfds)) {
1261 1256
                ioh->fd_write(ioh->opaque);
1262 1257
            }
1258

  
1259
            /* Do this last in case read/write handlers marked it for deletion */
1260
            if (ioh->deleted) {
1261
                QLIST_REMOVE(ioh, next);
1262
                qemu_free(ioh);
1263
            }
1263 1264
        }
1264 1265
    }
1265 1266

  

Also available in: Unified diff