mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 12:20:56 +00:00
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:
parent
df7b4b5bda
commit
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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user