mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
scenario: Use a weak ref to the pipeline
We are listening to it, we should not be owning a ref to it.
This commit is contained in:
parent
7e1249f089
commit
4cea878563
1 changed files with 14 additions and 1 deletions
|
@ -679,6 +679,17 @@ message_cb (GstBus * bus, GstMessage * message,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
_pipeline_freed_cb (GstValidateScenario * scenario, GObject * where_the_object_was)
|
||||
{
|
||||
GstValidateScenarioPrivate *priv = scenario->priv;
|
||||
|
||||
g_source_remove (priv->get_pos_id);
|
||||
priv->pipeline = NULL;
|
||||
|
||||
GST_DEBUG_OBJECT (scenario, "pipeline was freed");
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_load_scenario_file (GstValidateScenario * scenario,
|
||||
const gchar * scenario_file)
|
||||
|
@ -933,7 +944,9 @@ gst_validate_scenario_factory_create (GstValidateRunner * runner,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
scenario->priv->pipeline = gst_object_ref (pipeline);
|
||||
scenario->priv->pipeline = pipeline;
|
||||
g_object_weak_ref (G_OBJECT (pipeline),
|
||||
(GWeakNotify) _pipeline_freed_cb, scenario);
|
||||
gst_validate_reporter_set_name (GST_VALIDATE_REPORTER (scenario),
|
||||
g_strdup (scenario_name));
|
||||
|
||||
|
|
Loading…
Reference in a new issue