File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,11 +74,8 @@ pub fn panic_hook(info: &panic::PanicHookInfo) {
7474 log:: error!( "{info}" ) ;
7575
7676 // Prefer using the raw JS callback to avoid mutex lock contention inside the panic hook.
77- // Fall back to the editor handle path if needed.
7877 if let Err ( info) = send_panic_dialog_via_callback ( info) {
79- if let Err ( info) = send_panic_dialog ( info) {
80- send_panic_dialog_deferred ( info) ;
81- }
78+ send_panic_dialog_deferred ( info) ;
8279 }
8380}
8481
@@ -114,22 +111,10 @@ fn send_panic_dialog_via_callback(panic_info: String) -> Result<(), String> {
114111 } )
115112}
116113
117- fn send_panic_dialog ( panic_info : String ) -> Result < ( ) , String > {
118- EDITOR_HANDLE . with ( |editor_handle| {
119- let mut guard = editor_handle. try_lock ( ) ;
120- let Ok ( Some ( handle) ) = guard. as_deref_mut ( ) else {
121- return Err ( panic_info) ;
122- } ;
123-
124- handle. send_frontend_message_to_js_rust_proxy ( FrontendMessage :: DisplayDialogPanic { panic_info } ) ;
125- Ok ( ( ) )
126- } )
127- }
128-
129114#[ cfg( not( feature = "native" ) ) ]
130115fn send_panic_dialog_deferred ( panic_info : String ) {
131116 let callback = Closure :: once_into_js ( move || {
132- if send_panic_dialog ( panic_info) . is_err ( ) {
117+ if send_panic_dialog_via_callback ( panic_info) . is_err ( ) {
133118 log:: error!( "Failed to send crash dialog after panic because the editor handle is unavailable" ) ;
134119 }
135120 } ) ;
You can’t perform that action at this time.
0 commit comments