ReactiveX / RxSwift

Reactive Programming in Swift
MIT License
24.38k stars 4.17k forks source link

Dispose on aysnc queue #2395

Closed cyg02032015 closed 2 years ago

cyg02032015 commented 2 years ago

Short description of the issue:

object deinit on async queue cause Fatal error: Running on background thread.

Expected outcome:

rxswift dispose on main queue

What actually happens:

When i use RxDatasource to bind UITableView, then handle data on async queue, at the sametime that viewController deinit, but object deinit on async...

Crash Screenshot

Self contained code example that reproduces the issue: https://github.com/cyg02032015/rxswift_crash_test.git

// just click button present viewController and dismiss 
// that a simulation code in TestViewController.swift
deinit {
     coordinator.refresh()
}

// will crash in RxSwift/MainScheduler.swift at line 54

Platform/Environment

How easy is to reproduce? (chances of successful reproduce after running the self contained code)

Xcode version:

  Xcode version 13.2.1

Installation method:

I have multiple versions of Xcode installed: (so we can know if this is a potential cause of your issue)

Level of RxSwift knowledge: (this is so we can understand your level of knowledge and formulate the response in an appropriate manner)

freak4pc commented 2 years ago

I'm having a hard trouble understanding the issue here. Can you please share source code / a reproducible example?

Thanks.

freak4pc commented 2 years ago

Closed, no reply.