diff --git a/src/components/util/SpinnerImage.tsx b/src/components/util/SpinnerImage.tsx index e1c31388..a36269b3 100644 --- a/src/components/util/SpinnerImage.tsx +++ b/src/components/util/SpinnerImage.tsx @@ -48,6 +48,7 @@ export const SpinnerImage = forwardRef((props: IProps, imgRef: ForwardedRef { + let tmpImageSourceUrl: string; const imageRequest = requestManager.requestImage(src); const fetchImage = async () => { @@ -57,6 +58,7 @@ export const SpinnerImage = forwardRef((props: IProps, imgRef: ForwardedRef { + if (tmpImageSourceUrl) { + URL.revokeObjectURL(tmpImageSourceUrl); + } imageRequest.abortRequest(new Error('Component was unmounted')); }; }, [imgLoadRetryKey]); @@ -116,7 +121,6 @@ export const SpinnerImage = forwardRef((props: IProps, imgRef: ForwardedRef URL.revokeObjectURL(imageSourceUrl)} alt={alt} draggable={false} />