mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-01 21:18:52 +00:00
validate: reporter: prevent usage of destroyed runner
Fix crashes. Reviewed-by: Thibault Saunier <tsaunier@gnome.org> Differential Revision: https://phabricator.freedesktop.org/D1028
This commit is contained in:
parent
b5e020daa2
commit
b8c821dff4
1 changed files with 10 additions and 0 deletions
|
@ -61,6 +61,9 @@ gst_validate_reporter_default_init (GstValidateReporterInterface * iface)
|
|||
static void
|
||||
_free_priv (GstValidateReporterPrivate * priv)
|
||||
{
|
||||
if (priv->runner)
|
||||
g_object_remove_weak_pointer (G_OBJECT (priv->runner),
|
||||
(gpointer) & priv->runner);
|
||||
|
||||
if (g_log_handler == priv) {
|
||||
g_log_set_default_handler (g_log_default_handler, NULL);
|
||||
|
@ -335,6 +338,13 @@ gst_validate_reporter_set_runner (GstValidateReporter * reporter,
|
|||
|
||||
priv->runner = runner;
|
||||
|
||||
/* The runner is supposed to stay alive during the whole scenario but if
|
||||
* we are using another tracer we may have messages catched after it has been
|
||||
* destroyed. This may happen if the 'leaks' tracer detected leaks for
|
||||
* example. */
|
||||
if (runner)
|
||||
g_object_add_weak_pointer (G_OBJECT (runner), (gpointer) & priv->runner);
|
||||
|
||||
g_object_notify (G_OBJECT (reporter), "validate-runner");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue