Skip to content

Commit

Permalink
leaks: plug various memory leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
ensonic committed Sep 3, 2015
1 parent 5650c75 commit bce4a2d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/lib/core/sink-bin.c
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@ bt_sink_bin_get_recorder_elements (const BtSinkBin * const self)
if ((element = bt_sink_bin_make_and_configure_encodebin (profile))) {
list = g_list_append (list, element);
}
g_object_unref (profile);
} else {
GST_DEBUG ("no profile, do raw recording");
// encodebin starts with a queue already
Expand Down Expand Up @@ -1053,6 +1054,7 @@ bt_sink_bin_is_record_format_supported (BtSinkBinRecordFormat format)
} else {
format_states[format] = RECORD_FORMAT_STATE_MISSES_ELEMENTS;
}
g_object_unref (profile);
}
return format_states[format] > RECORD_FORMAT_STATE_NOT_CHECKED;
}
Expand Down
13 changes: 9 additions & 4 deletions src/ui/edit/machine-canvas-item.c
Original file line number Diff line number Diff line change
Expand Up @@ -1210,13 +1210,15 @@ bt_machine_canvas_item_set_property (GObject * object, guint property_id,
BT_MAIN_PAGE_MACHINES (g_value_get_object (value));
g_object_try_weak_ref (self->priv->main_page_machines);
break;
case MACHINE_CANVAS_ITEM_MACHINE:
g_object_try_unref (self->priv->machine);
self->priv->machine = BT_MACHINE (g_value_dup_object (value));
if (self->priv->machine) {
case MACHINE_CANVAS_ITEM_MACHINE:{
BtMachine *new_machine = (BtMachine *) g_value_get_object (value);
if (new_machine != self->priv->machine) {
GstElement *element;
GstBin *bin;

g_object_try_unref (self->priv->machine);
self->priv->machine = g_object_ref (new_machine);

GST_INFO ("set the machine %" G_OBJECT_REF_COUNT_FMT,
G_OBJECT_LOG_REF_COUNT (self->priv->machine));
g_object_set_qdata ((GObject *) self->priv->machine,
Expand Down Expand Up @@ -1245,6 +1247,7 @@ bt_machine_canvas_item_set_property (GObject * object, guint property_id,

if (!BT_IS_SINK_MACHINE (self->priv->machine)) {
if (bt_machine_enable_output_post_level (self->priv->machine)) {
g_object_try_weak_unref (self->priv->output_level);
g_object_get (self->priv->machine, "output-post-level",
&self->priv->output_level, NULL);
g_object_try_weak_ref (self->priv->output_level);
Expand All @@ -1255,6 +1258,7 @@ bt_machine_canvas_item_set_property (GObject * object, guint property_id,
}
if (!BT_IS_SOURCE_MACHINE (self->priv->machine)) {
if (bt_machine_enable_input_pre_level (self->priv->machine)) {
g_object_try_weak_unref (self->priv->input_level);
g_object_get (self->priv->machine, "input-pre-level",
&self->priv->input_level, NULL);
g_object_try_weak_ref (self->priv->input_level);
Expand All @@ -1265,6 +1269,7 @@ bt_machine_canvas_item_set_property (GObject * object, guint property_id,
}
}
break;
}
case MACHINE_CANVAS_ITEM_ZOOM:
self->priv->zoom = g_value_get_double (value);
GST_DEBUG ("set the zoom for machine_canvas_item: %f", self->priv->zoom);
Expand Down

0 comments on commit bce4a2d

Please sign in to comment.