From 97128b4185c73c22d79e93dc8bee0e328aad0355 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Fri, 26 May 2023 12:18:26 -0700 Subject: [PATCH] libsysprof-profile: transfer instrument ownership --- src/libsysprof-profile/sysprof-profiler.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/libsysprof-profile/sysprof-profiler.c b/src/libsysprof-profile/sysprof-profiler.c index 45a86a7d..a0639f41 100644 --- a/src/libsysprof-profile/sysprof-profiler.c +++ b/src/libsysprof-profile/sysprof-profiler.c @@ -90,6 +90,16 @@ sysprof_profiler_new (void) return g_object_new (SYSPROF_TYPE_PROFILER, NULL); } +/** + * sysprof_profiler_add_instrument: + * @self: a #SysprofProfiler + * @instrument: (transfer full): a #SysprofInstrument + * + * Adds @instrument to @profiler. + * + * When the recording session is started, @instrument will be directed to + * capture data into the destination capture file. + */ void sysprof_profiler_add_instrument (SysprofProfiler *self, SysprofInstrument *instrument) @@ -97,7 +107,7 @@ sysprof_profiler_add_instrument (SysprofProfiler *self, g_return_if_fail (SYSPROF_IS_PROFILER (self)); g_return_if_fail (SYSPROF_IS_INSTRUMENT (instrument)); - g_ptr_array_add (self->instruments, g_object_ref (instrument)); + g_ptr_array_add (self->instruments, instrument); } void