Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when using debounce (100%) #44

Closed
jakobmygind opened this issue Nov 6, 2019 · 3 comments · Fixed by #45
Closed

Crash when using debounce (100%) #44

jakobmygind opened this issue Nov 6, 2019 · 3 comments · Fixed by #45
Labels
bug Something isn't working

Comments

@jakobmygind
Copy link

jakobmygind commented Nov 6, 2019

Hi, in a very simple use case debounce seems to crash, but it might just be me using the cx proxy wrong?

This code crashes with EXC_BAD_INSTRUCTION:

 let pub = PassthroughSubject<Int, Never>()
        
        pub
            .debounce(for: 2.0, scheduler: DispatchQueue.global().cx)
            .sink(receiveValue: {
                print($0)
            })
            .store(in: &subscribers)
        
        (0...10).forEach(pub.send) //Crashes here: Thread 1: EXC_BAD_INSTRUCTION
@ddddxxx ddddxxx added the bug Something isn't working label Nov 7, 2019
ddddxxx added a commit that referenced this issue Nov 7, 2019
@ddddxxx
Copy link
Member

ddddxxx commented Nov 7, 2019

Fixed. The problem is actually caused by DispatchQueue, not Debounce

@ddddxxx
Copy link
Member

ddddxxx commented Nov 7, 2019

@luoxiu The problematic code was not tested. We should introduce code coverage analysis.

@jakobmygind
Copy link
Author

Thank you! Quick dispatch, so to speak :)

luoxiu pushed a commit that referenced this issue Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants