mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-05 17:09:48 +00:00
basevideo: Add destroy notify for the coder_hook to prevent memory leaks
Fixes bug #654293.
This commit is contained in:
parent
c62dd0f0c3
commit
f79460ff52
3 changed files with 8 additions and 0 deletions
|
@ -188,5 +188,8 @@ gst_base_video_codec_free_frame (GstVideoFrame * frame)
|
|||
g_list_foreach (frame->events, (GFunc) gst_event_unref, NULL);
|
||||
g_list_free (frame->events);
|
||||
|
||||
if (frame->coder_hook_destroy_notify && frame->coder_hook)
|
||||
frame->coder_hook_destroy_notify (frame->coder_hook);
|
||||
|
||||
g_free (frame);
|
||||
}
|
||||
|
|
|
@ -126,6 +126,8 @@ struct _GstVideoFrame
|
|||
int n_fields;
|
||||
|
||||
void *coder_hook;
|
||||
GDestroyNotify coder_hook_destroy_notify;
|
||||
|
||||
GstClockTime deadline;
|
||||
|
||||
gboolean force_keyframe;
|
||||
|
|
|
@ -1323,6 +1323,9 @@ gst_base_video_decoder_free_frame (GstVideoFrame * frame)
|
|||
g_list_foreach (frame->events, (GFunc) gst_event_unref, NULL);
|
||||
g_list_free (frame->events);
|
||||
|
||||
if (frame->coder_hook_destroy_notify && frame->coder_hook)
|
||||
frame->coder_hook_destroy_notify (frame->coder_hook);
|
||||
|
||||
g_free (frame);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue