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

removeListener has bugs #653

Open
zhangzhen123 opened this issue Dec 5, 2022 · 0 comments
Open

removeListener has bugs #653

zhangzhen123 opened this issue Dec 5, 2022 · 0 comments

Comments

@zhangzhen123
Copy link

override fun removeListener(listener: FetchListener): Fetch {
    synchronized(lock) {
        throwExceptionIfClosed()
        handlerWrapper.post {
            fetchHandler.removeListener(listener)
        }
        return this
    }
}

because it is asynchronous remove listener when the view or pager is destroy it still callback the listener if this moment has ui operation will crash

Process: com.julun.jiuliao, PID: 32210
java.lang.IllegalStateException: okText must not be null
    at com.julun.jiuliao.core.ui.dialog.GuideDownloadDialog$listener$2$1.onCompleted(GuideDownloadDialog.kt:94)
    at com.tonyodev.fetch2.fetch.ListenerCoordinator$mainListener$1$onCompleted$$inlined$synchronized$lambda$2.run(ListenerCoordinator.kt:246)
    at android.os.Handler.handleCallback(Handler.java:883)
    at android.os.Handler.dispatchMessage(Handler.java:100)
    at android.os.Looper.loop(Looper.java:230)
    at android.app.ActivityThread.main(ActivityThread.java:8051)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:526)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1034)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant