Windows - failure to release file handle from source

What is your operating system?
Windows 10 20H2 x64
Windows 10 21H1 x64
… and a few earlier releases

What is your Shotcut version (see Help > About Shotcut)? Is it 32-bit?
21.05.18 x64 portable
… and all prior versions going back ~2 years

Can you repeat the problem? If so, what are the steps?
I realize this could be a Windows issue, not necessarily a SC issue. But, perhaps, something can be done in SC to alleviate the issue.

I use SC for restoration of second-source material. It could be digitization of film, tape, analog capture, etc. Sometimes, it’s cheap camera, bad cell phone white balance, exposure, lighting, sound, etc. If I think the export of my SC edit is “better” than the original, I’m not opposed to deleting the original.

That’s where the problem happens. Occasionally, Windows Explorer complains it can’t delete the original file because it is in use by another process. I’ve resorted to file handle un-locking tools to explain (always shotcut.exe process) and to force-close the file handle to delete the source file.

Work-arounds are a re-boot. Sometimes, but not always, Task Manager to kill the explorer.exe processes and re-launch it. Recently, it’s been happening not long after rebooting.

Either SC isn’t thoroughly releasing file handles, or Windows Explorer is missing the release event. Either way, it’s a pain.

Are you attempting to delete the files while Shotcut is still running, or after Shotcut has been fully exited?

Is the media still loaded in the Source window or a playlist?

If Shotcut is the lock holder, I’m not sure why this helps or even works.

yes shotcut is running. I’ll run through restoration of a couple of videos at a time.

yes the encode job is complete before trying to delete the source files.

no the project is not open. I close the project when I submit the encode job.

no the source files aren’t open in another project.

I can’t say for sure whether killing explorer.exe and re-launching it actually helps. Mostly it’s just a full reboot cycle and start over.

It is a well known problem that files are not closed immediately upon File > Close or opening a different project or file in Source. There are things that still hold stale references until they are replaced by opening and selecting other things. It needs improvement, but usually the workaround is to close Shotcut - much less impactful than a reboot.

1 Like