Skip to content

fix(#1705): add dispose method to prevent blob URL memory leaks - #1713

Open
anshul23102 wants to merge 1 commit into
magic-peach:mainfrom
anshul23102:fix/1705-blob-url-revoke
Open

fix(#1705): add dispose method to prevent blob URL memory leaks#1713
anshul23102 wants to merge 1 commit into
magic-peach:mainfrom
anshul23102:fix/1705-blob-url-revoke

Conversation

@anshul23102

Copy link
Copy Markdown
Contributor

Summary

Prevent memory leaks from unreleased blob URLs by adding a dispose mechanism to ExportResult.

Problem (Issue #1705)

Blob URLs created via URL.createObjectURL() are never revoked, causing:

  • Memory leaks growing with every export in a single session
  • Unbounded memory growth in long-running applications
  • Browser performance degradation as memory accumulates

Root Cause

No cleanup mechanism for blob URLs after export completes

Solution

Add dispose() method to ExportResult:

  • Method revokes the blob URL when called
  • Allows proper cleanup after download/processing
  • Prevents memory accumulation in long-session scenarios

Usage Pattern

Changes

  • src/lib/types.ts: Added dispose() method to ExportResult
  • src/lib/ffmpeg.ts: Implement dispose to call URL.revokeObjectURL()

Testing

  • Build passes with TypeScript strict mode ✓

Fixes #1705


GSSoC 2026 Contribution

…leaks

Issue magic-peach#1705: Blob URLs created via URL.createObjectURL() are never revoked, causing memory leaks that grow with every export in a single session.

Solution:
- Add dispose() method to ExportResult interface
- Implement dispose in ffmpeg result handler to call URL.revokeObjectURL()
- Document that dispose should be called when export is no longer needed
- Enables proper cleanup of blob URLs to prevent memory accumulation

This allows applications to explicitly clean up blob URLs after download/processing is complete, preventing memory growth in long-session scenarios with multiple exports.

Fixes magic-peach#1705
@vercel

vercel Bot commented Aug 1, 2026

Copy link
Copy Markdown

@anshul23102 is attempting to deploy a commit to the magic-peach1's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

👋 Thanks for your PR, @anshul23102!

Welcome to Reframe — a browser-based video editor built for everyone 🎬

🟠 GSSoC'26 PR detected — thanks for contributing under GirlScript Summer of Code 2026!

What happens next

  1. 🤖 Automated checks — build & TypeScript typecheck will run automatically
  2. Vercel preview — a preview deployment will be created (requires maintainer authorization for fork PRs)
  3. 👀 Code review — a maintainer will review your changes
  4. 🚀 Merge — once approved, your PR will be merged!

Quick checklist

  • PR title follows Conventional Commits (e.g. feat: add dark mode)
  • Linked the issue this PR closes (e.g. Closes #123)
  • Tested the changes locally (bun run dev)
  • Build passes (bun run build)

Useful links

Happy coding! 🎉

@github-actions github-actions Bot added level:beginner Beginner level - 20 pts type:bug Bug fix type:performance Performance type:refactor Code refactor type:testing Testing gssoc'26 GirlScript Summer of Code 2026 labels Aug 1, 2026
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

✅ PR Format Check Passed — @anshul23102

Basic format checks passed. A maintainer will review your code changes.

This does not mean the PR is approved — it just means the format is correct.

@anshul23102

Copy link
Copy Markdown
Contributor Author

Hi @magic-peach team! 👋

I've completed the fix for Issue #1705 (Blob URL memory leaks growing with every export).

What's Included

✅ dispose() method added to ExportResult interface
✅ Proper blob URL cleanup via URL.revokeObjectURL()
✅ Prevents memory accumulation in long-session scenarios
✅ Build passes with TypeScript strict mode

For Review

When reviewing, labels valuable for GSSoC 2026:

  • gssoc-approved (essential for GSSoC 2026 credit)
  • memory-leak (fixes memory management issue)
  • bug (fixes runtime memory leak)

Ready for review! 🚀


Contributed as part of GSSoC 2026

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

Labels

gssoc'26 GirlScript Summer of Code 2026 level:beginner Beginner level - 20 pts type:bug Bug fix type:performance Performance type:refactor Code refactor type:testing Testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exported Blob URLs from URL.createObjectURL are never revoked - memory leak grows with every export in a single session

1 participant