This repository was archived by the owner on Oct 4, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
main/src/addins/MacPlatform/Dialogs Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ protected override NSSavePanel OnCreatePanel (OpenFileDialogData data)
7272
7373 public bool Run ( OpenFileDialogData data )
7474 {
75- var panelClosedSource = MacSystemInformation . OsVersion < MacSystemInformation . Catalina ? new CancellationTokenSource ( ) : null ;
75+ using var panelClosedSource = new CancellationTokenSource ( ) ;
7676 try {
7777 using ( var panel = CreatePanel ( data , out var state ) ) {
7878 bool pathAlreadySet = false ;
@@ -118,11 +118,11 @@ public bool Run (OpenFileDialogData data)
118118
119119 // TODO: support for data.CenterToParent, we could use sheeting.
120120 if ( panel . RunModal ( ) == 0 && ! pathAlreadySet ) {
121- panelClosedSource ? . Cancel ( ) ;
121+ panelClosedSource . Cancel ( ) ;
122122 IdeServices . DesktopService . FocusWindow ( parent ) ;
123123 return false ;
124124 }
125- panelClosedSource ? . Cancel ( ) ;
125+ panelClosedSource . Cancel ( ) ;
126126 if ( ! pathAlreadySet )
127127 data . SelectedFiles = MacSelectFileDialogHandler . GetSelectedFiles ( panel ) ;
128128
@@ -140,8 +140,6 @@ public bool Run (OpenFileDialogData data)
140140 }
141141 } catch ( Exception ex ) {
142142 LoggingService . LogInternalError ( "Error in Open File dialog" , ex ) ;
143- } finally {
144- panelClosedSource ? . Dispose ( ) ;
145143 }
146144 return true ;
147145 }
You can’t perform that action at this time.
0 commit comments