File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Sources/DataSources/RxHelper Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,13 @@ extension ObservableType {
1717 where DelegateProxy. ParentObject: ASDisplayNode {
1818
1919 let proxy = DelegateProxy . proxy ( for: object)
20- let unregisterDelegate = DelegateProxy . installForwardDelegate ( dataSource, retainDelegate: retainDataSource, onProxyForObject: object)
20+
21+ // ensure dispose unregisterDelegate on main thread
22+ let unregisterDelegate = ScheduledDisposable (
23+ scheduler: MainScheduler . instance,
24+ disposable: DelegateProxy . installForwardDelegate ( dataSource, retainDelegate: retainDataSource, onProxyForObject: object)
25+ )
26+
2127 // this is needed to flush any delayed old state (https://github.com/RxSwiftCommunity/RxDataSources/pull/75)
2228 object. layoutIfNeeded ( )
2329
@@ -49,7 +55,7 @@ extension ObservableType {
4955 default :
5056 break
5157 }
52- }
58+ }
5359
5460 return Disposables . create { [ weak object] in
5561 subscription. dispose ( )
You can’t perform that action at this time.
0 commit comments