fix weird bug where fdh in a list could become null
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Sun, 28 Nov 2010 22:03:07 +0000 (22:03 +0000)
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Sun, 28 Nov 2010 22:03:07 +0000 (22:03 +0000)
SVN revision: 55044

legacy/ecore/src/lib/ecore/ecore_main.c

index 312049f1cff3387ee7d88a2b3c16e6ae56a620de..d6f7666fce12abd7669d7da0e43a5b044f99ba31 100644 (file)
@@ -996,6 +996,7 @@ _ecore_main_prepare_handlers(void)
    /* call the prepare callback for all handlers with prep functions */
    EINA_LIST_FOREACH_SAFE(fd_handlers_with_prep, l, l2, fdh)
      {
+        if (!fdh) fd_handlers_with_prep = eina_list_remove_list(l, fd_handlers_with_prep);
         if (!fdh->delete_me && fdh->prep_func)
           {
              fdh->references++;
@@ -1185,6 +1186,7 @@ _ecore_main_fd_handlers_cleanup(void)
    if (!fd_handlers_to_delete) return;
    EINA_LIST_FOREACH_SAFE(fd_handlers_to_delete, l, l2, fdh)
      {
+        if (!fdh) fd_handlers_to_delete = eina_list_remove_list(l, fd_handlers_to_delete);
         /* fdh->delete_me should be set for all fdhs at the start of the list */
         if (fdh->references)
           continue;
@@ -1290,6 +1292,7 @@ _ecore_main_fd_handlers_buf_call(void)
    ret = 0;
    EINA_LIST_FOREACH_SAFE(fd_handlers_with_buffer, l, l2, fdh)
      {
+        if (!fdh) fd_handlers_with_buffer = eina_list_remove_list(l, fd_handlers_with_buffer);
         if ((!fdh->delete_me) && fdh->buf_func)
           {
              fdh->references++;