From 75925930cd752687ea4b69a0c84bfbc9fe57b6d1 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Sun, 20 Jan 2013 21:07:15 +0000 Subject: [PATCH] workaround for crash, see #14906 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73414 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/cocoa/filedlg.mm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/osx/cocoa/filedlg.mm b/src/osx/cocoa/filedlg.mm index 40fd8c4294..b159a1844b 100644 --- a/src/osx/cocoa/filedlg.mm +++ b/src/osx/cocoa/filedlg.mm @@ -448,6 +448,11 @@ bool wxFileDialog::CheckFile( const wxString& filename ) void wxFileDialog::SetupExtraControls(WXWindow nativeWindow) { NSSavePanel* panel = (NSSavePanel*) nativeWindow; + // for sandboxed app we cannot access the outer structures + // this leads to problems with extra controls, so as a temporary + // workaround for crashes we don't support those yet + if ( [panel contentView] == nil ) + return; wxNonOwnedWindow::Create( GetParent(), nativeWindow ); wxWindow* extracontrol = NULL; @@ -693,7 +698,9 @@ void wxFileDialog::ModalFinishedCallback(void* panel, int returnCode) if (GetModality() == wxDIALOG_MODALITY_WINDOW_MODAL) SendWindowModalDialogEvent ( wxEVT_WINDOW_MODAL_DIALOG_CLOSED ); - UnsubclassWin(); + // workaround for sandboxed app, see above + if ( m_isNativeWindowWrapper ) + UnsubclassWin(); [(NSSavePanel*) panel setAccessoryView:nil]; } -- 2.45.2