mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-16 09:45:24 -04:00
fix: use cached blob URL in _createChip to prevent memory leak (#1266)
_createChip called URL.createObjectURL directly, bypassing the _getPreviewUrl/_revokePreviewUrl cache. Each re-render of the attachment strip leaked blob URLs that were never revoked.
This commit is contained in:
committed by
GitHub
parent
a8395b4e4c
commit
9c68ceafeb
@@ -112,7 +112,7 @@ function _createChip(f, idx) {
|
||||
chip.classList.add('thumb-image'); // lets CSS overlay the remove-X on the corner (mobile)
|
||||
const img = document.createElement('img');
|
||||
img.className = 'thumb-img';
|
||||
img.src = URL.createObjectURL(f);
|
||||
img.src = _getPreviewUrl(f);
|
||||
img.alt = f.name || 'image';
|
||||
chip.appendChild(img);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user