Skip to content

fix(web): Prevent Object URL memory leaks in laptop screen generator #96

Open

Description

@jamro

Problem

The laptop screen generator creates a new Object URL using URL.createObjectURL(file) whenever a user selects an image, but never releases it with URL.revokeObjectURL().

Repeatedly loading large images can retain unnecessary memory for the lifetime of the page.

Location

web/js/screens.js — loadImage()

Introduced in PR #88.

Expected behavior

Object URLs should be released once they are no longer needed, without affecting the currently displayed image or PDF generation.

Acceptance criteria

  • Revoke Object URLs after successful image loading when safe.
  • Revoke Object URLs when image loading fails.
  • Avoid retaining URLs from previously selected images.
  • Verify that repeated image replacements do not accumulate unused Object URLs.
  • Ensure image previews and PDF downloads continue working correctly.

Activity

  1. Abhishek-Jalkhare commented on Oct 28, 2026

    @Abhishek-Jalkhare
    Contributor

    I want to work on this.

  2. jamro commented on Oct 28, 2026

    @jamro
    OwnerAuthor

    Absolutely, thanks for offering to help! Feel free to go ahead and work on this. Once ready, please submit a PR referencing this issue. Happy to review it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions