mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-08 02:16:17 +01:00
Do not use revents as not updated
revents is set in the same function after some lines. This check was using revents from previous loop. This had the problem of causing two poll execution for every changes to poll records. Note that is not possible to move the code after revents is updated as probably poll_changed is TRUE causing the function to exit. Adapted from a patch by Frediano Ziglio, https://bugzilla.gnome.org/show_bug.cgi?id=761102
This commit is contained in:
parent
e4ee3079c5
commit
48ea710ee3
13
glib/gmain.c
13
glib/gmain.c
@ -3695,10 +3695,17 @@ g_main_context_check (GMainContext *context,
|
||||
|
||||
TRACE (GLIB_MAIN_CONTEXT_BEFORE_CHECK (context, max_priority, fds, n_fds));
|
||||
|
||||
if (context->wake_up_rec.revents)
|
||||
for (i = 0; i < n_fds; i++)
|
||||
{
|
||||
TRACE (GLIB_MAIN_CONTEXT_WAKEUP_ACKNOWLEDGE (context));
|
||||
g_wakeup_acknowledge (context->wakeup);
|
||||
if (fds[i].fd == context->wake_up_rec.fd)
|
||||
{
|
||||
if (fds[i].revents)
|
||||
{
|
||||
TRACE (GLIB_MAIN_CONTEXT_WAKEUP_ACKNOWLEDGE (context));
|
||||
g_wakeup_acknowledge (context->wakeup);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* If the set of poll file descriptors changed, bail out
|
||||
|
Loading…
Reference in New Issue
Block a user