This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch ecore-glib
in repository efl.
View the commit online.
commit f5ce4f82907d3d897efd6d95f1f4151e61b4b77b
Author: dimmus <dmitri.chudi...@gmail.com>
AuthorDate: Wed Nov 15 18:25:31 2023 +0500
ecore: solve error with gsource = null
Compiling using -Dglib=true and -Dg-mainloop=true causes glib errors every time when efreet_icon_cache_create is invoked (ex., run and stop elementary_config and observe the terminal output).
So, i added error message in place where ecore_glib_source may be undefined. The issue was with undefined ecore_glib_source variable in _ecore_main_loop_setup function. Here _ecore_main_fdh_poll_add was used before actual ecore_glib_source definition.
@fixed
---
src/lib/ecore/ecore_main.c | 53 +++++++++++++++++++++++++---------------------
1 file changed, 29 insertions(+), 24 deletions(-)
diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c
index 99ecd575ad..b39fa39b0c 100644
--- a/src/lib/ecore/ecore_main.c
+++ b/src/lib/ecore/ecore_main.c
@@ -447,7 +447,11 @@ _ecore_main_fdh_poll_add(Efl_Loop_Data *pd EINA_UNUSED, Ecore_Fd_Handler *fdh)
fdh->gfd.events = _gfd_events_from_fdh(fdh);
fdh->gfd.revents = 0;
DBG("adding gpoll on %d %08x", fdh->fd, fdh->gfd.events);
- g_source_add_poll(ecore_glib_source, &fdh->gfd);
+ if (ecore_glib_source)
+ g_source_add_poll(ecore_glib_source, &fdh->gfd);
+ else
+ ERR("Failed to add gpoll on %d %08x. GSource is NULL",
+ fdh->fd, fdh->gfd.events);
#endif
}
return r;
@@ -939,29 +943,6 @@ quit:
static void
_ecore_main_loop_setup(Eo *obj, Efl_Loop_Data *pd)
{
- // Please note that this function is being also called in case of a bad
- // fd to reset the main loop.
-#ifdef HAVE_SYS_EPOLL_H
- pd->epoll_fd = epoll_create(1);
- if (pd->epoll_fd < 0) WRN("Failed to create epoll fd!");
- else
- {
- eina_file_close_on_exec(pd->epoll_fd, EINA_TRUE);
-
- pd->epoll_pid = getpid();
-
- // add polls on all our file descriptors
- Ecore_Fd_Handler *fdh;
- EINA_INLIST_FOREACH(pd->fd_handlers, fdh)
- {
- if (fdh->delete_me) continue;
- _ecore_epoll_add(pd->epoll_fd, fdh->fd,
- _ecore_poll_events_from_fdh(fdh), fdh);
- _ecore_main_fdh_poll_add(pd, fdh);
- }
- }
-#endif
-
if (obj == ML_OBJ)
{
#ifdef HAVE_LIBUV
@@ -1072,6 +1053,30 @@ _ecore_main_loop_setup(Eo *obj, Efl_Loop_Data *pd)
}
#endif
}
+
+ // Please note that this function is being also called in case of a bad
+ // fd to reset the main loop.
+#ifdef HAVE_SYS_EPOLL_H
+ pd->epoll_fd = epoll_create(1);
+ if (pd->epoll_fd < 0) WRN("Failed to create epoll fd!");
+ else
+ {
+ eina_file_close_on_exec(pd->epoll_fd, EINA_TRUE);
+
+ pd->epoll_pid = getpid();
+
+ // add polls on all our file descriptors
+ Ecore_Fd_Handler *fdh;
+ EINA_INLIST_FOREACH(pd->fd_handlers, fdh)
+ {
+ if (fdh->delete_me) continue;
+ _ecore_epoll_add(pd->epoll_fd, fdh->fd,
+ _ecore_poll_events_from_fdh(fdh), fdh);
+ _ecore_main_fdh_poll_add(pd, fdh);
+ }
+ }
+#endif
+
_ecore_main_timechanges_start(obj);
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.