fixed deadlock scenarion where g_signal_lookup() would be called with the

Fri Oct 27 05:35:14 2000  Tim Janik  <timj@gtk.org>

        * gsignal.c (g_signal_newv): fixed deadlock scenarion where
        g_signal_lookup() would be called with the signal lock being
        held. reported by james henstridge.

        * gclosure.c (g_closure_set_meta_marshal): fixed memcpy/overwrite bug
        reported by owen.
This commit is contained in:
Tim Janik
2000-10-27 03:33:31 +00:00
committed by Tim Janik
parent 32ef70d4b2
commit 8a572c0da1
3 changed files with 34 additions and 27 deletions

View File

@@ -161,16 +161,16 @@ g_closure_set_meta_marshal (GClosure *closure,
n = CLOSURE_N_NOTIFIERS (closure);
notifiers = closure->notifiers;
closure->notifiers = g_renew (GClosureNotifyData, NULL, CLOSURE_N_NOTIFIERS (closure) + 1);
closure->notifiers[0].data = marshal_data;
closure->notifiers[0].notify = (GClosureNotify) meta_marshal;
if (notifiers)
{
/* usually the meta marshal will be setup right after creation, so the
* memcpy() should be rare-case scenario
* g_memmove() should be rare-case scenario
*/
memcpy (closure->notifiers + 1, notifiers, CLOSURE_N_NOTIFIERS (closure) * sizeof (notifiers[0]));
g_memmove (closure->notifiers + 1, notifiers, CLOSURE_N_NOTIFIERS (closure) * sizeof (notifiers[0]));
g_free (notifiers);
}
closure->notifiers[0].data = marshal_data;
closure->notifiers[0].notify = (GClosureNotify) meta_marshal;
closure->meta_marshal = 1;
}