ecore - fd handlers - only delete legacy eo objects in handlers
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Wed, 21 Feb 2018 06:45:55 +0000 (15:45 +0900)
committerWonki Kim <wonki_.kim@samsung.com>
Mon, 9 Apr 2018 02:27:41 +0000 (11:27 +0900)
if its a non-legacy loop handler that also binds an fd handler
internally (the 2 things are linked as a pair) then on loop del, dont
del the objet as the obj del should handle things elsehwere.

src/lib/ecore/ecore_main.c

index f515fbc..3db509c 100644 (file)
@@ -136,6 +136,7 @@ struct _Ecore_Fd_Handler
    Eina_Bool               error_active : 1;
    Eina_Bool               delete_me : 1;
    Eina_Bool               file : 1;
+   Eina_Bool               legacy : 1;
 };
 GENERIC_ALLOC_SIZE_DECLARE(Ecore_Fd_Handler);
 
@@ -1490,6 +1491,7 @@ ecore_main_fd_handler_add(int                    fd,
    fdh = _ecore_main_fd_handler_add(efl_loop_main_get(EFL_LOOP_CLASS),
                                     ML_DAT, NULL, fd, flags, func, data,
                                     buf_func, buf_data, EINA_FALSE);
+   fdh->legacy = EINA_TRUE;
    return fdh;
 }
 
@@ -1731,7 +1733,7 @@ _ecore_main_content_clear(Efl_Loop_Data *pd)
         pd->fd_handlers = (Ecore_Fd_Handler *)
           eina_inlist_remove(EINA_INLIST_GET(pd->fd_handlers),
                              EINA_INLIST_GET(fdh));
-        if (fdh->handler) efl_del(fdh->handler);
+        if ((fdh->handler) && (fdh->legacy)) efl_del(fdh->handler);
         else
           {
 // XXX: can't do this because this fd handler is legacy and might