mirror of
https://github.com/status-im/metro.git
synced 2025-01-19 23:48:58 +00:00
Completely clean the bundler once a client gets disconnected
Reviewed By: BYK Differential Revision: D7211827 fbshipit-source-id: 4490d2f520b24595a1d5833b69ecca3e408ba3c5
This commit is contained in:
parent
c26a68e5c7
commit
13f9ea7d3a
@ -144,7 +144,7 @@ class DeltaTransformer extends EventEmitter {
|
||||
* clean up memory and resources once this instance is not used anymore.
|
||||
*/
|
||||
end() {
|
||||
this._deltaCalculator.removeListener('change', this._onFileChange);
|
||||
this.removeAllListeners();
|
||||
|
||||
return this._deltaCalculator.end();
|
||||
}
|
||||
|
@ -89,9 +89,9 @@ class HmrServer<TClient: Client> {
|
||||
}
|
||||
|
||||
onClientDisconnect(client: TClient) {
|
||||
// We can safely remove all listeners from the delta transformer since the
|
||||
// We can safely stop the delta transformer since the
|
||||
// transformer is not shared between clients.
|
||||
client.deltaTransformer.removeAllListeners('change');
|
||||
client.deltaTransformer.end();
|
||||
}
|
||||
|
||||
async _handleFileChange(client: Client) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user