Skip to content

Commit

Permalink
Merge pull request #263 from kyleve/kve/fix-memory-leak
Browse files Browse the repository at this point in the history
Fix memory leak which caused populated list views to leak, also prep 0.15.1
  • Loading branch information
kyleve authored Jan 26, 2021
2 parents cf3fcb9 + e640772 commit c4c1795
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 11 deletions.
2 changes: 1 addition & 1 deletion BlueprintUILists.podspec
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,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
Expand Down Expand Up @@ -285,7 +291,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
Expand Down
2 changes: 1 addition & 1 deletion ListableUI.podspec
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
39 changes: 39 additions & 0 deletions ListableUI/Tests/ListView/ListViewTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 6 additions & 6 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c4c1795

Please sign in to comment.