d2phap / d2phap/ImageGlass

dllhost.exe holds active file lock on images opened and quickly closed

Open
#2,416 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

🐞 bug
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
  1. 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.

  2. Open any image file using ImageGlass.

  3. As soon as the image loads, close ImageGlass.

  4. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.