Skip to content

Commit 246f03f

Browse files
committed
Cancel render operation when view is released
1 parent 81e8d03 commit 246f03f

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ All notable changes to this project will be documented in this file.
1313
- Added by [William Entriken](https://github.com/fulldecent) in Regards to Issue
1414
[#76](https://github.com/fulldecent/FDWaveformView/issues/86).
1515

16+
#### Fixed
17+
- Cancel waveform render operation when view is released
18+
- Added by [Philippe Jayet](https://github.com/pjay)
19+
1620
---
1721

1822
## [2.2.0](https://github.com/fulldecent/FDWaveformView/releases/tag/2.2.0)

Source/FDWaveformView.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,10 @@ open class FDWaveformView: UIView {
304304
super.init(frame: rect)
305305
setup()
306306
}
307+
308+
deinit {
309+
inProgressWaveformRenderOperation?.cancel()
310+
}
307311

308312
/// If the cached waveform or in progress waveform is insufficient for the current frame
309313
fileprivate func cacheStatus() -> CacheStatus {

0 commit comments

Comments
 (0)