зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1741978 - Clean up at shutdown after `--start-debugger-server`. r=devtools-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D139152
This commit is contained in:
Родитель
df7b4b5bda
Коммит
b415214de0
|
@ -1145,6 +1145,20 @@ DevToolsStartup.prototype = {
|
|||
const listener = new SocketListener(devToolsServer, socketOptions);
|
||||
listener.open();
|
||||
dump("Started devtools server on " + portOrPath + "\n");
|
||||
|
||||
// Prevent leaks on shutdown.
|
||||
const close = () => {
|
||||
Services.obs.removeObserver(close, "quit-application");
|
||||
dump("Stopped devtools server on " + portOrPath + "\n");
|
||||
if (listener) {
|
||||
listener.close();
|
||||
}
|
||||
if (devToolsServer) {
|
||||
devToolsServer.destroy();
|
||||
}
|
||||
serverLoader.destroy();
|
||||
};
|
||||
Services.obs.addObserver(close, "quit-application");
|
||||
} catch (e) {
|
||||
dump("Unable to start devtools server on " + portOrPath + ": " + e);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче