diff --git a/BlueprintUILists.podspec b/BlueprintUILists.podspec index 3a8a389a4..e7939e91a 100644 --- a/BlueprintUILists.podspec +++ b/BlueprintUILists.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = 'BlueprintUILists' - s.version = '0.15.0' + s.version = '0.15.1' s.summary = 'Declarative list views for iOS apps that deploy back to iOS 11.0.' s.homepage = 'https://github.com/kyleve/Listable' s.license = 'Apache License, Version 2.0' diff --git a/CHANGELOG.md b/CHANGELOG.md index e01d12668..0923196c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,12 @@ # Past Releases +# [0.15.1] - 2021-01-25 + +### Fixed + +- [Fix a memory leak in `ListView`](https://github.com/kyleve/Listable/pull/263) that caused all `ListViews` with content in them to leak. + # [0.15.0] - 2021-01-22 ### Added @@ -287,7 +293,8 @@ Earlier releases were ad-hoc and not tracked. To see all changes, please reference [closed PRs on Github](https://github.com/kyleve/Listable/pulls?q=is%3Apr+is%3Aclosed). -[Main]: https://github.com/kyleve/Listable/compare/0.15.0...HEAD +[Main]: https://github.com/kyleve/Listable/compare/0.15.1...HEAD +[0.15.1]: https://github.com/kyleve/Listable/compare/0.15.0...0.15.1 [0.15.0]: https://github.com/kyleve/Listable/compare/0.14.2...0.15.0 [0.14.1]: https://github.com/kyleve/Listable/compare/0.14.1...0.14.2 [0.14.1]: https://github.com/kyleve/Listable/compare/0.13.0...0.14.1 diff --git a/ListableUI.podspec b/ListableUI.podspec index 8f46fc45b..a962669ed 100644 --- a/ListableUI.podspec +++ b/ListableUI.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = 'ListableUI' - s.version = '0.15.0' + s.version = '0.15.1' s.summary = 'Declarative list views for iOS apps that deploy back to iOS 11.0.' s.homepage = 'https://github.com/kyleve/Listable' s.license = 'Apache License, Version 2.0' diff --git a/ListableUI/Sources/Internal/Presentation State/PresentationState.ItemState.swift b/ListableUI/Sources/Internal/Presentation State/PresentationState.ItemState.swift index 1056e6aef..d81b13c9d 100644 --- a/ListableUI/Sources/Internal/Presentation State/PresentationState.ItemState.swift +++ b/ListableUI/Sources/Internal/Presentation State/PresentationState.ItemState.swift @@ -66,8 +66,8 @@ protocol ItemContentCoordinatorDelegate : AnyObject public struct ItemStateDependencies { - var reorderingDelegate : ReorderingActionsDelegate - var coordinatorDelegate : ItemContentCoordinatorDelegate + weak var reorderingDelegate : ReorderingActionsDelegate? + weak var coordinatorDelegate : ItemContentCoordinatorDelegate? var environmentProvider : () -> ListEnvironment } diff --git a/ListableUI/Tests/ListView/ListViewTests.swift b/ListableUI/Tests/ListView/ListViewTests.swift index 0bd234b1e..338084730 100644 --- a/ListableUI/Tests/ListView/ListViewTests.swift +++ b/ListableUI/Tests/ListView/ListViewTests.swift @@ -13,6 +13,45 @@ import XCTest class ListViewTests: XCTestCase { + func test_no_retain_cycles() + { + // Verify that there's no retain cycles within the list, + // by making a list, putting content in it, and then waiting + // for the list to be deallocated by testing a weak pointer. + + weak var weakList : ListView? = nil + + autoreleasepool { + var listView : ListView? = ListView(frame: CGRect(x: 0, y: 0, width: 200, height: 400)) + + listView?.configure { list in + + list.content.header = HeaderFooter(TestSupplementary()) + list.content.footer = HeaderFooter(TestSupplementary()) + list.content.overscrollFooter = HeaderFooter(TestSupplementary()) + + list("content") { section in + section.header = HeaderFooter(TestSupplementary()) + section.footer = HeaderFooter(TestSupplementary()) + + section += TestContent(title: "1") + section += TestContent(title: "2") + section += TestContent(title: "3") + } + } + + self.waitForOneRunloop() + + weakList = listView + + listView = nil + } + + self.waitFor { + weakList == nil + } + } + func test_changing_supplementary_views() { // Ensure that we can swap out a supplementary view without any other changes. diff --git a/Podfile.lock b/Podfile.lock index f4e54cfc5..b1b2332ac 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -2,15 +2,15 @@ PODS: - BlueprintUI (0.20.0) - BlueprintUICommonControls (0.20.0): - BlueprintUI - - BlueprintUILists (0.15.0): + - BlueprintUILists (0.15.1): - BlueprintUI - ListableUI - - BlueprintUILists/Tests (0.15.0): + - BlueprintUILists/Tests (0.15.1): - BlueprintUI - ListableUI - EnglishDictionary (1.0.0.LOCAL) - - ListableUI (0.15.0) - - ListableUI/Tests (0.15.0): + - ListableUI (0.15.1) + - ListableUI/Tests (0.15.1): - EnglishDictionary - Snapshot - Snapshot (1.0.0.LOCAL) @@ -45,9 +45,9 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: BlueprintUI: d26766f3e006d1f9348cba6a7f15efc64da74cb3 BlueprintUICommonControls: b7b6a10581203f4bd6283c9d2a9b810d513d804b - BlueprintUILists: f18013df0909d82d463c3a18f4c477b2034040c0 + BlueprintUILists: b28ac85a6989295dc22eb6563a68ad3685009fcf EnglishDictionary: f03968b9382ddc5c8dd63535efbf783c6cd45f1c - ListableUI: fc0cb30981776da135ac6e50792c8e1ba9aa6b9f + ListableUI: 9f085c174cb13abe18c458d15dcbe128b21a92a5 Snapshot: cda3414db426919d09f775434b36289c8e864183 PODFILE CHECKSUM: c1209f66d9213201c70fd26a2f0907a6e29e8cbe