diff --git a/src/Files.App/Helpers/FileOperationsHelpers.cs b/src/Files.App/Helpers/FileOperationsHelpers.cs index c2ad1c7f2ce9..906f7a68bf4b 100644 --- a/src/Files.App/Helpers/FileOperationsHelpers.cs +++ b/src/Files.App/Helpers/FileOperationsHelpers.cs @@ -122,7 +122,7 @@ public static Task SetClipboard(string[] filesToCopy, DataPackageOperation opera if (!SafetyExtensions.IgnoreExceptions(() => { using var shi = new ShellItem(fileToDeletePath[i]); - var file = SafetyExtensions.IgnoreExceptions(() => GetFirstFile(shi)) ?? shi; + using var file = SafetyExtensions.IgnoreExceptions(() => GetFirstFile(shi)) ?? shi; if (file.Properties.GetProperty(PKEY_FilePlaceholderStatus) == PS_CLOUDFILE_PLACEHOLDER) { // Online only files cannot be tried for deletion, so they are treated as to be permanently deleted.