-
-
Notifications
You must be signed in to change notification settings - Fork 194
Hotfix for Release 2.0.4 #438
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
Hotfix for Release 2.0.4 #438
Conversation
|
||
override fun destroy() { | ||
if (!isDestroyed) { | ||
destroyARCore() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You use LifeCycleObserver as the main place to call ArCore lifecycle functions
And you don't need to call it here again
I didn't find any side cases
} | ||
|
||
fun destroyARCore() { | ||
val scope = lifecycle?.coroutineScope ?: CoroutineScope(Dispatchers.IO) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I wrote in issue - Coroutines is not fit tool to execute background operation a specialty on Destroy callback
super.destroy() | ||
} | ||
|
||
fun destroyARCore() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is no reasons to place public function cuz it's internal behavior
Same as all others lifecycle calls
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notes
looks good to me |
Discussion - #435
Issues:
The second call of destroy() was removed to prevent crash
Coroutines were replaced to ExecutorService