Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit ff57067

Browse files
committed
Bug 1944901 - Crash reporter shutdown is interrupted by macOS default behaviors r=gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D236230
1 parent c9b652e commit ff57067

File tree

1 file changed

+6
-8
lines changed
  • toolkit/crashreporter/client/app/src/ui/macos

1 file changed

+6
-8
lines changed

toolkit/crashreporter/client/app/src/ui/macos/mod.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,6 @@ objc_class! {
279279
self.windows = windows.unwrap();
280280

281281
}
282-
283-
#[sel(applicationShouldTerminateAfterLastWindowClosed:)]
284-
fn application_should_terminate_after_window_closed(&mut self, _app: Ptr<cocoa::NSApplication>) -> runtime::BOOL {
285-
runtime::YES
286-
}
287282
}
288283
}
289284

@@ -335,10 +330,13 @@ objc_class! {
335330

336331
#[sel(windowWillClose:)]
337332
fn window_will_close(&mut self, _notification: Ptr<cocoa::NSNotification>) {
338-
if self.modal {
339-
unsafe {
340-
let nsapp = cocoa::NSApplication::sharedApplication();
333+
unsafe {
334+
let nsapp = cocoa::NSApplication::sharedApplication();
335+
if self.modal {
341336
nsapp.stopModal();
337+
} else if self.instance == nsapp.mainWindow().0 {
338+
// Stop the application, causing run_loop to exit.
339+
nsapp.stop_(self.instance);
342340
}
343341
}
344342
}

0 commit comments

Comments
 (0)