Bug 1568150 - Stop spinning the event loop when destroying the inspector front. r=gl

InspectorFront.destroy isn't returning a promise. So the `await` in the toolbox
code is not relevant and is only spinning the event loop.
Removing it introduce races which should be fixed.
The toolbox buttons shouldn't try to unhighlight if the inspector isn't used.

Differential Revision: https://phabricator.services.mozilla.com/D39407

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Alexandre Poirot 2019-07-29 09:20:29 +00:00
Родитель 2ce6e59528
Коммит 6b20f244f3
2 изменённых файлов: 5 добавлений и 3 удалений

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

@ -273,8 +273,10 @@ class ToolboxToolbar extends Component {
ref: "frameMenuButton",
title: description,
onCloseButton: async () => {
await toolbox.initInspector();
toolbox.highlighter.unhighlight();
// Only try to unhighlight if the highlighter has been started
if (toolbox.highlighter) {
toolbox.highlighter.unhighlight();
}
},
},
this.createFrameList

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

@ -3412,7 +3412,7 @@ Toolbox.prototype = {
// Temporary fix for bug #1493131 - inspector has a different life cycle
// than most other fronts because it is closely related to the toolbox.
await this._inspector.destroy();
this._inspector.destroy();
this._inspector = null;
this._highlighter = null;