Skip to content

Commit 22c5734

Browse files
Hongyan JiangGitHub Enterprise
authored andcommitted
better memory management
1 parent e75ec4a commit 22c5734

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Changelog
22

3+
34
## 1.8.4
5+
- better memory management
46
- add drop beacon handler
57

68
## 1.8.3

Sources/InstanaAgent/Beacons/BeaconFlusher.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,13 @@ class BeaconFlusher {
5050
let urlSession = URLSession(configuration: .default)
5151
var errors = [Error]()
5252
var retryStep: Int = 0
53-
private var flushItem: DispatchWorkItem?
53+
private weak var flushItem: DispatchWorkItem? {
54+
willSet {
55+
flushItem?.cancel()
56+
cancel()
57+
}
58+
}
59+
5460
private let completion: (BeaconFlusher.Result) -> Void
5561
private let queue: DispatchQueue
5662
private let externalSend: Sender? // Used for Unit Testing

0 commit comments

Comments
 (0)