WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
66805
MediaElementAudioSourceNode lives longer than necessary
https://bugs.webkit.org/show_bug.cgi?id=66805
Summary
MediaElementAudioSourceNode lives longer than necessary
Chris Rogers
Reported
2011-08-23 13:40:30 PDT
On Tue, Aug 23, 2011 at 12:49 PM, Chris Evans <
cevans@google.com
> wrote: Here's my immediate puzzle: <script> a = document.createElement("audio"); delete a; window.gc(); </script> <script> a = document.createElement("audio"); c = new webkitAudioContext(); m = c.createMediaElementSource(a); delete a; delete c; delete m; window.gc(); </script> Can you help me work out why the first script destroys the HTMLAudioElement but the second does not? (You can put a printf in the constructor and destructor if you like) Something must be referencing that DOM node but I can't work out what the code is doing to cause that. ..................... Hi Chris, Yes, basically the problem ultimately is coming about because an AudioContext is an ActiveDOMObject and lives as long as the document exists (it will be available for garbage collection only after its stop() method is called). Also, in the nascent MediaElementAudioSourceNode implementation, the context is calling ref() on MediaElementAudioSourceNode even before it's connected. It should only ref() the node when it's actually connected, then deref() when it's disconnected.
Attachments
Add attachment
proposed patch, testcase, etc.
Abhishek Arya
Comment 1
2011-08-25 10:48:23 PDT
tracking security chromium bug -
http://code.google.com/p/chromium/issues/detail?id=94186
Chris Rogers
Comment 2
2011-09-20 12:48:02 PDT
This bug is confusing two different problems. The original security issue was fixed here:
http://trac.webkit.org/changeset/94608
The second issue is not nearly as serious which is that the MediaElementAudioSourceNode *could* be deleted through garbage collection sooner than it actually is (since the context keeps it around longer than necessary). It's not a leak - just stays around longer than necessary
Radar WebKit Bug Importer
Comment 3
2012-08-21 17:27:53 PDT
<
rdar://problem/12147106
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug