mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
Fix an event leak
Original commit message from CVS: Fix an event leak Ne need to save signals on longjmp
This commit is contained in:
parent
bdd6df925e
commit
6c538d527b
4 changed files with 10 additions and 5 deletions
|
@ -233,8 +233,10 @@ cothread_destroy (cothread_state *thread)
|
|||
|
||||
GST_INFO (GST_CAT_COTHREADS, "destroy cothread %d %p %d", threadnum, thread, ctx->current);
|
||||
|
||||
/* we have to unlock here because we might be switched out with the lock held */
|
||||
cothread_unlock (thread);
|
||||
|
||||
#ifndef COTHREAD_ATOMIC
|
||||
g_mutex_unlock (thread->lock);
|
||||
g_mutex_free (thread->lock);
|
||||
#endif
|
||||
|
||||
|
@ -429,7 +431,7 @@ cothread_switch (cothread_state * thread)
|
|||
#ifdef GST_ARCH_PRESETJMP
|
||||
GST_ARCH_PRESETJMP ();
|
||||
#endif
|
||||
enter = sigsetjmp (current->jmp, 1);
|
||||
enter = setjmp (current->jmp);
|
||||
if (enter != 0) {
|
||||
GST_DEBUG (0, "enter thread #%d %d %p<->%p (%d)\n", current->threadnum, enter,
|
||||
current->sp, current->top_sp, (char*)current->top_sp - (char*)current->sp);
|
||||
|
@ -447,7 +449,7 @@ cothread_switch (cothread_state * thread)
|
|||
if (thread->flags & COTHREAD_STARTED) {
|
||||
GST_DEBUG (0, "in thread \n");
|
||||
/* switch to it */
|
||||
siglongjmp (thread->jmp, 1);
|
||||
longjmp (thread->jmp, 1);
|
||||
}
|
||||
else {
|
||||
GST_ARCH_SETUP_STACK ((char*)thread->sp);
|
||||
|
|
|
@ -54,7 +54,7 @@ struct _cothread_state {
|
|||
|
||||
int flags;
|
||||
void *sp;
|
||||
sigjmp_buf jmp;
|
||||
jmp_buf jmp;
|
||||
/* is this needed any more? */
|
||||
void *top_sp;
|
||||
void *pc;
|
||||
|
|
|
@ -92,6 +92,8 @@ gst_event_new (GstEventType type)
|
|||
void
|
||||
gst_event_free (GstEvent* event)
|
||||
{
|
||||
GST_INFO (GST_CAT_EVENT, "freeing event %p", event);
|
||||
|
||||
g_mutex_lock (_gst_event_chunk_lock);
|
||||
if (GST_EVENT_SRC (event)) {
|
||||
gst_object_unref (GST_EVENT_SRC (event));
|
||||
|
|
|
@ -2017,14 +2017,15 @@ gst_pad_event_default (GstPad *pad, GstEvent *event)
|
|||
pads = g_list_next (pads);
|
||||
}
|
||||
}
|
||||
gst_event_free (event);
|
||||
/* we have to try to schedule another element because this one is deisabled */
|
||||
gst_element_yield (element);
|
||||
break;
|
||||
default:
|
||||
g_warning ("no default handler for event\n");
|
||||
gst_event_free (event);
|
||||
break;
|
||||
}
|
||||
gst_event_free (event);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue