Bug 1695580 - Release WebSocketChannel::mTargetThread on main. r=necko-reviewers,dragana

When mTargetThread is WebSocketImpl it must be released on main since it
implements nsISupportsWeakReference, and clearing weak references is not
threadsafe.

Differential Revision: https://phabricator.services.mozilla.com/D109783
This commit is contained in:
Andreas Pehrson 2021-04-06 12:16:12 +00:00
Родитель be0dbd75d4
Коммит bed338184d
1 изменённых файлов: 2 добавлений и 0 удалений

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

@ -1181,6 +1181,8 @@ WebSocketChannel::~WebSocketChannel() {
NS_ReleaseOnMainThread("WebSocketChannel::mLoadGroup", mLoadGroup.forget());
NS_ReleaseOnMainThread("WebSocketChannel::mLoadInfo", mLoadInfo.forget());
NS_ReleaseOnMainThread("WebSocketChannel::mTargetThread",
mTargetThread.forget());
NS_ReleaseOnMainThread("WebSocketChannel::mService", mService.forget());
}