Skip to content

Conversation

@JakeWharton
Copy link
Contributor

No description provided.

@qwwdfsad qwwdfsad self-requested a review March 4, 2020 15:05
Copy link
Member

@qwwdfsad qwwdfsad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@qwwdfsad qwwdfsad merged commit 8d8a8fb into Kotlin:develop Mar 4, 2020
private object Disposed : Disposable {
override fun isDisposed() = true
override fun dispose() = Unit
awaitClose { disposableRef.getAndSet(Disposables.disposed())?.dispose() }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I treated this private object Disposed as a private "token" similarly to DisposableHelper.DISPOSED in Rx itself (they have the warning there "don't leak it"), but here I didn't do compareAndSet(Disposed, ...) because comparing to initial null was enough, so I think your change is correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. Just trying to save APK size anywhere I can by reusing existing stuff.

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

Successfully merging this pull request may close these issues.

3 participants