From aa7e6d76667b22a4ad1303b6f2db0263c89ac247 Mon Sep 17 00:00:00 2001 From: seg Date: Tue, 6 Aug 2024 14:36:10 +0200 Subject: [PATCH 1/3] Elaborated object lifecycle for garbage collection --- .../src/System/Diagnostics/ActivitySource.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivitySource.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivitySource.cs index ebaddab4ec80c..fc05a19ea921f 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivitySource.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivitySource.cs @@ -29,7 +29,8 @@ public ActivitySource(string name) : this(name, version: "", tags: null) {} public ActivitySource(string name, string? version = "") : this(name, version, tags: null) {} /// - /// Construct an ActivitySource object with the input name + /// Construct an ActivitySource object with the input name. + /// Objects are kept alive by a static reference added and are not garbage collected. /// /// The name of the ActivitySource object /// The version of the component publishing the tracing info. From be8a1cce9b1cc771c9ff201ba25694af53c4940c Mon Sep 17 00:00:00 2001 From: seg Date: Tue, 6 Aug 2024 14:37:39 +0200 Subject: [PATCH 2/3] remove typo --- .../src/System/Diagnostics/ActivitySource.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivitySource.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivitySource.cs index fc05a19ea921f..df2eef25ae31c 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivitySource.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivitySource.cs @@ -30,7 +30,7 @@ public ActivitySource(string name, string? version = "") : this(name, version, t /// /// Construct an ActivitySource object with the input name. - /// Objects are kept alive by a static reference added and are not garbage collected. + /// Objects are kept alive by a static reference and are not garbage collected. /// /// The name of the ActivitySource object /// The version of the component publishing the tracing info. From 97f8828506e42de9b9faa73ccb698376be2c8db5 Mon Sep 17 00:00:00 2001 From: seg Date: Tue, 6 Aug 2024 14:49:02 +0200 Subject: [PATCH 3/3] even more descriptive --- .../src/System/Diagnostics/ActivitySource.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivitySource.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivitySource.cs index df2eef25ae31c..babf3b94820f4 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivitySource.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivitySource.cs @@ -30,7 +30,7 @@ public ActivitySource(string name, string? version = "") : this(name, version, t /// /// Construct an ActivitySource object with the input name. - /// Objects are kept alive by a static reference and are not garbage collected. + /// Objects are kept alive by a static reference and are not garbage collected unless explicit call to Dispose(). /// /// The name of the ActivitySource object /// The version of the component publishing the tracing info.