Improve ASRangeController dealloc-safety.

(1) We can't size nodes without a delegate, and if our owning controller
has been deallocated, our delegate will be nil.  Handle this more
gracefully.

(2) Our teardown code needs to be executed on the main thread, but it's
conceivable that we might hit refcount 0 on a background queue.  Force
deallocation to occur on the main thread.

Closes #27.
This commit is contained in:
Nadine Salter
2014-10-21 18:51:46 -07:00
parent 72f9cb9d73
commit d0b7a015e8
2 changed files with 5 additions and 1 deletions

View File

@@ -26,7 +26,7 @@ typedef struct {
* a working range, and is responsible for handling AsyncDisplayKit machinery (sizing cell nodes, enqueueing and
* cancelling their asynchronous layout and display, and so on).
*/
@interface ASRangeController : NSObject
@interface ASRangeController : ASDealloc2MainObject
/**
* Notify the receiver that its delegate's data source has been set or changed. This is like -[UITableView reloadData]