-
-
Notifications
You must be signed in to change notification settings - Fork 18
Fix various things that might keep thumbnail files locked (BL-16122) #7808
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -498,7 +498,7 @@ HtmlThumbNailer.ThumbnailOptions thumbnailOptions | |
| RebuildThumbNail( | ||
| book, | ||
| thumbnailOptions, | ||
| (info, image) => { }, | ||
| (info, image) => image?.Dispose(), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Disposing shared The new callback Prompt for agentsWas this helpful? React with 👍 or 👎 to provide feedback. |
||
| (info, ex) => | ||
| { | ||
| throw ex; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -721,7 +721,11 @@ public void UpdateThumbnailAsync(Book.Book book) | |
| UpdateThumbnailAsync( | ||
| book, | ||
| BookThumbNailer.GetCoverThumbnailOptions(-1, Guid.Empty), | ||
| RefreshOneThumbnail, | ||
| (bookInfo, image) => | ||
| { | ||
| RefreshOneThumbnail(bookInfo, image); | ||
| image?.Dispose(); | ||
| }, | ||
|
Comment on lines
+724
to
+728
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Disposing shared The new callback wrapping Prompt for agentsWas this helpful? React with 👍 or 👎 to provide feedback. |
||
| HandleThumbnailerErrror | ||
| ); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚩 RebuildThumbNail has an additional undisposed image path for readonly thumbnails
In
RebuildThumbNailatBookThumbNailer.cs:536-543, when the thumbnail is readonly,TryGetPremadeThumbnailreturns an image loaded from file (caller-owned per the new comments). This image is passed tocallback(book.BookInfo, thumb). ForRebuildThumbNailNow(line 501), the callback disposes it correctly. ForCollectionModel.UpdateThumbnailAsync(line 724-728), it also disposes correctly. However, for the 4-parameterUpdateThumbnailAsyncoverload at line 706, callers provide their own callbacks and may not dispose the image — this is a pre-existing concern not introduced by this PR, but worth noting since the PR adds ownership documentation.(Refers to lines 536-543)
Was this helpful? React with 👍 or 👎 to provide feedback.