From ca1ff92c511cd264886fc2384a4275d8566e1d0b Mon Sep 17 00:00:00 2001 From: Manish Singh Date: Wed, 9 Jul 2003 23:31:20 +0000 Subject: [PATCH] check if context->poll_chunk is set before trying to destroy it. For Wed Jul 9 16:27:26 2003 Manish Singh * glib/gmain.c (g_main_context_unref_and_unlock): check if context->poll_chunk is set before trying to destroy it. For example, This can happen if no sources are added to a context before it is freed. --- ChangeLog | 7 +++++++ ChangeLog.pre-2-10 | 7 +++++++ ChangeLog.pre-2-12 | 7 +++++++ ChangeLog.pre-2-4 | 7 +++++++ ChangeLog.pre-2-6 | 7 +++++++ ChangeLog.pre-2-8 | 7 +++++++ glib/gmain.c | 5 +++-- 7 files changed, 45 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b031509..9d0be6e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Wed Jul 9 16:27:26 2003 Manish Singh + + * glib/gmain.c (g_main_context_unref_and_unlock): check if + context->poll_chunk is set before trying to destroy it. For example, + This can happen if no sources are added to a context before it is + freed. + 2003-07-09 Morten Welinder * glib/gprintf.c (g_vasprintf): Avoid var declaration after diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index b031509..9d0be6e 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,10 @@ +Wed Jul 9 16:27:26 2003 Manish Singh + + * glib/gmain.c (g_main_context_unref_and_unlock): check if + context->poll_chunk is set before trying to destroy it. For example, + This can happen if no sources are added to a context before it is + freed. + 2003-07-09 Morten Welinder * glib/gprintf.c (g_vasprintf): Avoid var declaration after diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index b031509..9d0be6e 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,10 @@ +Wed Jul 9 16:27:26 2003 Manish Singh + + * glib/gmain.c (g_main_context_unref_and_unlock): check if + context->poll_chunk is set before trying to destroy it. For example, + This can happen if no sources are added to a context before it is + freed. + 2003-07-09 Morten Welinder * glib/gprintf.c (g_vasprintf): Avoid var declaration after diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index b031509..9d0be6e 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,10 @@ +Wed Jul 9 16:27:26 2003 Manish Singh + + * glib/gmain.c (g_main_context_unref_and_unlock): check if + context->poll_chunk is set before trying to destroy it. For example, + This can happen if no sources are added to a context before it is + freed. + 2003-07-09 Morten Welinder * glib/gprintf.c (g_vasprintf): Avoid var declaration after diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index b031509..9d0be6e 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,10 @@ +Wed Jul 9 16:27:26 2003 Manish Singh + + * glib/gmain.c (g_main_context_unref_and_unlock): check if + context->poll_chunk is set before trying to destroy it. For example, + This can happen if no sources are added to a context before it is + freed. + 2003-07-09 Morten Welinder * glib/gprintf.c (g_vasprintf): Avoid var declaration after diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index b031509..9d0be6e 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,10 @@ +Wed Jul 9 16:27:26 2003 Manish Singh + + * glib/gmain.c (g_main_context_unref_and_unlock): check if + context->poll_chunk is set before trying to destroy it. For example, + This can happen if no sources are added to a context before it is + freed. + 2003-07-09 Morten Welinder * glib/gprintf.c (g_vasprintf): Avoid var declaration after diff --git a/glib/gmain.c b/glib/gmain.c index 45ecb5f..d732ffb 100644 --- a/glib/gmain.c +++ b/glib/gmain.c @@ -576,8 +576,9 @@ g_main_context_unref_and_unlock (GMainContext *context) g_ptr_array_free (context->pending_dispatches, TRUE); g_free (context->cached_poll_array); - - g_mem_chunk_destroy (context->poll_chunk); + + if (context->poll_chunk) + g_mem_chunk_destroy (context->poll_chunk); #ifdef G_THREADS_ENABLED if (g_thread_supported()) -- 2.7.4