Store the `Progress` instance weakly

This commit is contained in:
Sindre Sorhus 2020-02-10 03:20:20 +07:00
parent cbc3e53a03
commit 3365c2be40
2 changed files with 3 additions and 1 deletions

View File

@ -9,7 +9,7 @@ public final class DockProgress {
NSApp.dockTile.contentView = $0
}
public static var progressInstance: Progress? {
public static weak var progressInstance: Progress? {
didSet {
guard let progressInstance = progressInstance else {
return

View File

@ -57,6 +57,8 @@ progress?.becomeCurrent(withPendingUnitCount: 1)
DockProgress.progressInstance = progress
```
The given `Progress` instance is weakly stored. It's up to you to retain it.
## Styles
It comes with three styles. PR welcome for more.