Skip to content

Commit

Permalink
fix: workaround for deadlock on iOS 18 (#449)
Browse files Browse the repository at this point in the history
  • Loading branch information
knopp authored Oct 6, 2024
1 parent c738db5 commit 955c810
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ class WidgetSnapshotterStateImpl extends WidgetSnapshotterState {
// We have pending snapshot for widget that we haven't built yet
if (_pendingSnapshots.any((s) => _getRenderObject(s.key) == null)) {
setState(() {});
// TODO(knopp): This is fragile and the underlying reason for the deadlock
// needs to be investigates.
// On iOS 18 next frame vsync never comes while the run loop is being
// polled. This is a ugly workaround to make sure that we do not
// deadlock.
WidgetsBinding.instance.scheduleWarmUpFrame();
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
_checkSnapshots();
});
Expand Down
2 changes: 2 additions & 0 deletions super_native_extensions/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#![allow(clippy::arc_with_non_send_sync)]
// TODO(knopp): Fine grained way to prevent dead code warnings in code that is not used on all platforms.
#![allow(dead_code)]
// TODO(knopp): Remove once supported on stable
#![allow(clippy::needless_lifetimes)]

use std::ffi::c_void;

Expand Down

0 comments on commit 955c810

Please sign in to comment.