dllhost.exe holds active file lock on images opened and quickly closed
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 14.4k
- Forks
- 752
- Avg merge
- 10d 14h
- Merged PRs (30d)
- 1
Description
Windows OS version
Windows 11 Pro 25H2
ImageGlass version
9.6.1.807 (64-bit)
ImageGlass release
Classic
1️⃣ Steps to reproduce
-
Navigate to a folder containing a high volume of image files (e.g., 50+ files consisting of .png, .jpg, or .webp). Doesn't necessarily have to be a super big folder, but I've noticed that it increases the chance of this happening.
-
Open any image file using ImageGlass.
-
As soon as the image loads, close ImageGlass.
-
Attempt to move, rename, or delete the parent folder.
2️⃣ Actual behavior
The file management operation fails because some files(s) in the folder remain locked by dllhost.exe (COM Surrogate). The lock persists until dllhost.exe is manually terminated via Task Manager or process management tools (Like ShowWhatProcessLocksFile).
3️⃣ Expected behavior
ImageGlass should release all file handles and thumbnail/preview rendering threads upon closing, allowing immediate file operations (moving, renaming, deleting) without process locking.
4️⃣ Screenshots / Video / Sample image file
No response
5️⃣ Additional context
Affected File Formats: Confirmed on .png, .jpg, and .webp. Most likely happens with all image files.
Probable Cause: Opening an image in a folder with many assets likely triggers Windows shell thumbnail/preview handlers via dllhost.exe (COM Surrogate) for adjacent preloading or shell integration. Closing the main application rapidly before these background handler processes finish causes dllhost.exe to hold an orphaned file lock.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue on Windows 11 with a folder containing 50+ PNG, JPG, or WEBP files, then use Task Manager or ShowWhatProcessLocksFile to confirm dllhost.exe holds the lock after ImageGlass closes. Trace the close path and thumbnail or preview handling, and verify that moving, renaming, or deleting the folder succeeds immediately after closing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100