From 4b5a3bb837c54b48bd731bc32db5407c66e962bc Mon Sep 17 00:00:00 2001 From: Dominik Kapusta Date: Wed, 17 Apr 2024 12:42:10 +0200 Subject: [PATCH] Keep a weak reference to UserScriptMessageBroker (#783) Task/Issue URL: https://app.asana.com/0/1177771139624306/1207088650619407/f Description: Fix a memory leak by holding a weak reference to UserScriptMessageBroker in PerformanceMetricsSubfeature. --- .../BrokenSiteReporting/PerformanceMetricsSubfeature.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/PrivacyDashboard/BrokenSiteReporting/PerformanceMetricsSubfeature.swift b/Sources/PrivacyDashboard/BrokenSiteReporting/PerformanceMetricsSubfeature.swift index b1889da0f..5557476df 100644 --- a/Sources/PrivacyDashboard/BrokenSiteReporting/PerformanceMetricsSubfeature.swift +++ b/Sources/PrivacyDashboard/BrokenSiteReporting/PerformanceMetricsSubfeature.swift @@ -24,7 +24,7 @@ public class PerformanceMetricsSubfeature: Subfeature { public var messageOriginPolicy: MessageOriginPolicy = .all public var featureName: String = "performanceMetrics" - public var broker: UserScriptMessageBroker? + public weak var broker: UserScriptMessageBroker? private weak var targetWebview: WKWebView? private var timer: Timer?