Bug 1157995 - Tell the cycle collector about Navigator::mMediaDevices. r=smaug

This commit is contained in:
Andrew McCreight 2015-05-20 09:55:06 -07:00
Родитель 01b6eb2526
Коммит b63ced61a3
3 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -201,6 +201,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Navigator)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAudioChannelManager)
#endif
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCameraManager)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMediaDevices)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMessagesManager)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDeviceStorageStores)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTimeManager)
@ -307,6 +308,7 @@ Navigator::Invalidate()
#endif
mCameraManager = nullptr;
mMediaDevices = nullptr;
if (mMessagesManager) {
mMessagesManager = nullptr;

Просмотреть файл

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<body>
<script>
// This should not leak.
var a = navigator;
navigator.mediaDevices._ = null;
</script>
</body>

Просмотреть файл

@ -202,3 +202,4 @@ load xhr_empty_datauri.html
load xhr_html_nullresponse.html
load structured_clone_container_throws.html
load 1154598.xhtml
load 1157995.html