File tree Expand file tree Collapse file tree 1 file changed +1
-2
lines changed
Plugins/Flow.Launcher.Plugin.Explorer/Views Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Original file line number Diff line number Diff line change @@ -150,13 +150,12 @@ public static string GetFolderSize(string folderPath)
150
150
{
151
151
var directoryInfo = new DirectoryInfo ( folderPath ) ;
152
152
long size = 0 ;
153
- var cancellationTokenSource = new CancellationTokenSource ( TimeSpan . FromSeconds ( 3 ) ) ;
153
+ using var cancellationTokenSource = new CancellationTokenSource ( TimeSpan . FromSeconds ( 3 ) ) ;
154
154
foreach ( var file in directoryInfo . EnumerateFiles ( "*" , SearchOption . AllDirectories ) )
155
155
{
156
156
if ( cancellationTokenSource . Token . IsCancellationRequested )
157
157
{
158
158
// Timeout occurred, return unknown size
159
- cancellationTokenSource . Dispose ( ) ;
160
159
return Main . Context . API . GetTranslation ( "plugin_explorer_plugin_tooltip_more_info_unknown" ) ;
161
160
}
162
161
size += file . Length ;
You can’t perform that action at this time.
0 commit comments