summaryrefslogtreecommitdiff
path: root/gmain.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>1998-12-19 22:11:49 +0000
committerOwen Taylor <otaylor@src.gnome.org>1998-12-19 22:11:49 +0000
commitbb19315fbdb4ae54704778e6dec7b7319c95419a (patch)
treea606c47c3bb1278928d5b5d4a7ab786b9776347d /gmain.c
parentce257b8137638052ee00c7ea95fdb7092cce9382 (diff)
downloadglib-bb19315fbdb4ae54704778e6dec7b7319c95419a.tar.gz
Allocate space for pollfd's _after_ adding poll wake-up-pipe record.
Sat Dec 19 16:56:02 1998 Owen Taylor <otaylor@redhat.com> * gmain.c (g_main_poll): Allocate space for pollfd's _after_ adding poll wake-up-pipe record. * gmain.c (g_main_add_poll): Changed name of internal function g_main_add_poll_unlocked() back from the non-sensical g_main_add_unlocking_poll().
Diffstat (limited to 'gmain.c')
-rw-r--r--gmain.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gmain.c b/gmain.c
index 6821269f5..3fcc873d8 100644
--- a/gmain.c
+++ b/gmain.c
@@ -83,7 +83,7 @@ struct _GPollRec
static void g_main_poll (gint timeout,
gboolean use_priority,
gint priority);
-static void g_main_add_unlocking_poll (gint priority,
+static void g_main_add_poll_unlocked (gint priority,
GPollFD *fd);
static gboolean g_timeout_prepare (gpointer source_data,
@@ -649,7 +649,7 @@ g_main_poll (gint timeout,
gboolean use_priority,
gint priority)
{
- GPollFD *fd_array = g_new (GPollFD, n_poll_records);
+ GPollFD *fd_array;
GPollRec *pollrec;
gint i;
@@ -663,9 +663,11 @@ g_main_poll (gint timeout,
wake_up_rec.fd = wake_up_pipe[0];
wake_up_rec.events = G_IO_IN;
- g_main_add_unlocking_poll (0, &wake_up_rec);
+ g_main_add_poll_unlocked (0, &wake_up_rec);
}
+ fd_array = g_new (GPollFD, n_poll_records);
+
pollrec = poll_records;
i = 0;
while (pollrec && (!use_priority || priority >= pollrec->priority))
@@ -710,14 +712,14 @@ g_main_add_poll (GPollFD *fd,
gint priority)
{
G_LOCK (main_loop);
- g_main_add_unlocking_poll (priority, fd);
+ g_main_add_poll_unlocked (priority, fd);
G_UNLOCK (main_loop);
}
/* HOLDS: main_loop_lock */
static void
-g_main_add_unlocking_poll (gint priority,
- GPollFD *fd)
+g_main_add_poll_unlocked (gint priority,
+ GPollFD *fd)
{
GPollRec *lastrec, *pollrec, *newrec;