Re: File API "oneTimeOnly" is too poorly defined

2012/3/29 Bronislav Klučka <Bronislav.Klucka@bauglir.com>

> If I understand you, you find it problematic that by using weak ref, URL
> would for some time reference actual Blob and other time it would not?
>

The problem is that the following code might or might not work, depending
on the behavior of the browser's GC:

url = createObjectURL(blob);
blob = null;
setTimeout(function() { img.src = url; }, 0);

If the timer executes before GC collects the blob, this works, because the
URL is still valid.  Otherwise, it fails, because--since the Blob no longer
exists--the URL is no longer valid.

-- 
Glenn Maynard

Received on Friday, 30 March 2012 13:21:59 UTC