[sysprof] libsysprof: handle NULL governor case gracefully
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sysprof] libsysprof: handle NULL governor case gracefully
- Date: Wed, 20 Jul 2022 23:25:18 +0000 (UTC)
commit 5a88d5a0a14b68ddc898990947d89df26ac7895c
Author: Christian Hergert <chergert redhat com>
Date: Wed Jul 20 16:24:52 2022 -0700
libsysprof: handle NULL governor case gracefully
src/libsysprof/sysprof-governor-source.c | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
---
diff --git a/src/libsysprof/sysprof-governor-source.c b/src/libsysprof/sysprof-governor-source.c
index 5277e01d..a24aaa81 100644
--- a/src/libsysprof/sysprof-governor-source.c
+++ b/src/libsysprof/sysprof-governor-source.c
@@ -285,19 +285,12 @@ enable_paranoid_cb (GObject *object,
if (!self->disable_governor)
sysprof_source_emit_finished (SYSPROF_SOURCE (self));
- else
- {
- sysprof_helpers_set_governor_async (helpers,
- self->old_governor,
- NULL,
- enable_governor_cb,
- self);
-
- /* Can't use g_steal_pointer above, as that might set self = NULL before
- * self->old_governor is evaluated → crash
- */
- self = NULL;
- }
+ else if (self->old_governor != NULL)
+ sysprof_helpers_set_governor_async (helpers,
+ self->old_governor,
+ NULL,
+ enable_governor_cb,
+ g_object_ref (self));
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]