flowkey / UIKit-cross-platform

Cross-platform Swift implementation of UIKit, mostly for Android
MIT License
594 stars 40 forks source link

fix a crash in UIscreen init/deinit #381

Closed michaelknoch closed 1 year ago

michaelknoch commented 1 year ago

Type of change: bugfix

Motivation (current vs expected behavior)

We experience a crash when destroying and to recreating UIScreen a few times. It happens roughly 1 out of 10 times. It's harder to reproduce in a debug build.

SIGTRAP: Trace/breakpoint trap

0 libswiftCore.so +0x1fa800 $ss17_assertionFailure__4file4line5flagss5NeverOs12StaticStringV_SSAHSus6UInt32VtF
1 libUIKit.so +0x1b3fb4     UIKit.UIScreen.__allocating_init() -> UIKit.UIScreen (UIScreen.swift:74)
2 libUIKit.so +0x1732dc     UIKit.nativeInit(env (androidNativeInit.swift:33)
3 libart.so +0x440550       art_quick_generic_jni_trampoline
4 libart.so +0x20a2ac       nterp_helper
5 base.odex +0x193f53a      0x7174a1853e
6 libart.so +0x20a250       nterp_helper
7 base.odex +0x193fac2      0x7174a18ac6
8 boot.oat +0xe8909c        android.view.SurfaceView.updateSurface

https://app.bugsnag.com/flowkey-gmbh/mobile-app/errors/638a30164fb0c8000955fc8c?filters[app.release_stage]=production&filters[release.seen_in]=2.45.0%20(2154926)&filters[event.unhandled]=true&filters[user.id]=Nhf6LvAP8oWmYDKF6

Please check if the PR fulfills these requirements