Skip to content

Fix image resource leak, redundant hash computation, and silent plugin failures#3748

Merged
guiyanakuang merged 1 commit intomainfrom
fix/issue-3747-type-plugin-fixes
Feb 7, 2026
Merged

Fix image resource leak, redundant hash computation, and silent plugin failures#3748
guiyanakuang merged 1 commit intomainfrom
fix/issue-3747-type-plugin-fixes

Conversation

@guiyanakuang
Copy link
Copy Markdown
Member

Closes #3747

Changes

  • ImagesPasteItem: Add clear() override — Mirrors FilesPasteItem.clear() logic to delete stored image files when paste data is removed, fixing a disk space leak
  • ImagesPasteItem: Optimize bind() — Use direct constructor instead of createImagesPasteItem() to avoid redundant hash/count/size recalculation (hash computation can be expensive)
  • DesktopRtfTypePlugin: Close InputStream — Use .use { it.readBytes() } to ensure the stream from Java AWT Transferable is properly closed
  • DesktopRtfTypePlugin: Log RTF conversion failure — Add logger.warn when rtfToHtml() returns null
  • DesktopImageTypePlugin: Log image write failure — Add logger.warn when writeImage() returns false

…gin failures

- Add clear() override to ImagesPasteItem to clean up stored images on deletion
- Avoid redundant hash/count/size recalculation in ImagesPasteItem.bind()
- Close InputStream with .use {} in DesktopRtfTypePlugin
- Add logger.warn for RTF conversion and image write failures

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
@guiyanakuang guiyanakuang merged commit c3084d6 into main Feb 7, 2026
2 checks passed
@guiyanakuang guiyanakuang deleted the fix/issue-3747-type-plugin-fixes branch February 7, 2026 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix image resource leak, redundant hash computation, and silent plugin failures

1 participant