mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 23:36:38 +00:00
glmixer: remove redundant creation and free of GPtrArrays
Also plugs a memory leak
This commit is contained in:
parent
4131456751
commit
21ea062cc8
1 changed files with 4 additions and 16 deletions
|
@ -425,12 +425,6 @@ gst_gl_mixer_reset (GstGLMixer * mix)
|
||||||
mix->priv->negotiated = FALSE;
|
mix->priv->negotiated = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
_free_pad_frame_data (gpointer data)
|
|
||||||
{
|
|
||||||
g_slice_free1 (sizeof (GstGLMixerFrameData), data);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_gl_mixer_init (GstGLMixer * mix)
|
gst_gl_mixer_init (GstGLMixer * mix)
|
||||||
{
|
{
|
||||||
|
@ -441,9 +435,6 @@ gst_gl_mixer_init (GstGLMixer * mix)
|
||||||
mix->fbo = 0;
|
mix->fbo = 0;
|
||||||
mix->depthbuffer = 0;
|
mix->depthbuffer = 0;
|
||||||
|
|
||||||
mix->frames = g_ptr_array_new_full (4, _free_pad_frame_data);
|
|
||||||
mix->array_buffers = g_ptr_array_new_full (4, NULL);
|
|
||||||
|
|
||||||
/* initialize variables */
|
/* initialize variables */
|
||||||
gst_gl_mixer_reset (mix);
|
gst_gl_mixer_reset (mix);
|
||||||
}
|
}
|
||||||
|
@ -455,9 +446,6 @@ gst_gl_mixer_finalize (GObject * object)
|
||||||
|
|
||||||
g_mutex_clear (&mix->lock);
|
g_mutex_clear (&mix->lock);
|
||||||
|
|
||||||
g_ptr_array_free (mix->frames, TRUE);
|
|
||||||
g_ptr_array_free (mix->array_buffers, TRUE);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1028,7 +1016,6 @@ gst_gl_mixer_start (GstAggregator * agg)
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_gl_mixer_stop (GstAggregator * agg)
|
gst_gl_mixer_stop (GstAggregator * agg)
|
||||||
{
|
{
|
||||||
guint i;
|
|
||||||
GstGLMixer *mix = GST_GL_MIXER (agg);
|
GstGLMixer *mix = GST_GL_MIXER (agg);
|
||||||
GstGLMixerClass *mixer_class = GST_GL_MIXER_GET_CLASS (mix);
|
GstGLMixerClass *mixer_class = GST_GL_MIXER_GET_CLASS (mix);
|
||||||
|
|
||||||
|
@ -1036,9 +1023,10 @@ gst_gl_mixer_stop (GstAggregator * agg)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
GST_OBJECT_LOCK (agg);
|
GST_OBJECT_LOCK (agg);
|
||||||
for (i = 0; i < GST_ELEMENT (agg)->numsinkpads; i++) {
|
g_ptr_array_free (mix->frames, TRUE);
|
||||||
g_slice_free1 (sizeof (GstGLMixerFrameData), mix->frames->pdata[i]);
|
mix->frames = NULL;
|
||||||
}
|
g_ptr_array_free (mix->array_buffers, TRUE);
|
||||||
|
mix->array_buffers = NULL;
|
||||||
GST_OBJECT_UNLOCK (agg);
|
GST_OBJECT_UNLOCK (agg);
|
||||||
|
|
||||||
if (mixer_class->reset)
|
if (mixer_class->reset)
|
||||||
|
|
Loading…
Reference in a new issue