mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Merge pull request #5228 from ConnorChristie/memory-leaks
Upgrade obs-store and fix memory leaks
This commit is contained in:
commit
9b3b70433e
@ -177,7 +177,7 @@ module.exports = class MetamaskController extends EventEmitter {
|
|||||||
blockTracker: this.blockTracker,
|
blockTracker: this.blockTracker,
|
||||||
getGasPrice: this.getGasPrice.bind(this),
|
getGasPrice: this.getGasPrice.bind(this),
|
||||||
})
|
})
|
||||||
this.txController.on('newUnapprovedTx', opts.showUnapprovedTx.bind(opts))
|
this.txController.on('newUnapprovedTx', () => opts.showUnapprovedTx())
|
||||||
|
|
||||||
this.txController.on(`tx:status-update`, (txId, status) => {
|
this.txController.on(`tx:status-update`, (txId, status) => {
|
||||||
if (status === 'confirmed' || status === 'failed') {
|
if (status === 'confirmed' || status === 'failed') {
|
||||||
@ -1229,8 +1229,10 @@ module.exports = class MetamaskController extends EventEmitter {
|
|||||||
)
|
)
|
||||||
dnode.on('remote', (remote) => {
|
dnode.on('remote', (remote) => {
|
||||||
// push updates to popup
|
// push updates to popup
|
||||||
const sendUpdate = remote.sendUpdate.bind(remote)
|
const sendUpdate = (update) => remote.sendUpdate(update)
|
||||||
this.on('update', sendUpdate)
|
this.on('update', sendUpdate)
|
||||||
|
// remove update listener once the connection ends
|
||||||
|
dnode.on('end', () => this.removeListener('update', sendUpdate))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1280,10 +1282,12 @@ module.exports = class MetamaskController extends EventEmitter {
|
|||||||
* @param {*} outStream - The stream to provide public config over.
|
* @param {*} outStream - The stream to provide public config over.
|
||||||
*/
|
*/
|
||||||
setupPublicConfig (outStream) {
|
setupPublicConfig (outStream) {
|
||||||
|
const configStream = asStream(this.publicConfigStore)
|
||||||
pump(
|
pump(
|
||||||
asStream(this.publicConfigStore),
|
configStream,
|
||||||
outStream,
|
outStream,
|
||||||
(err) => {
|
(err) => {
|
||||||
|
configStream.destroy()
|
||||||
if (err) log.error(err)
|
if (err) log.error(err)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
8
package-lock.json
generated
8
package-lock.json
generated
@ -21822,9 +21822,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"obs-store": {
|
"obs-store": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/obs-store/-/obs-store-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/obs-store/-/obs-store-3.0.2.tgz",
|
||||||
"integrity": "sha512-ZHK0fwDZEecEvdiqQGnxrEshbqibVgsq4aIIe/5PIT8fGGprTTuGw1RXLMy5G1VN/KtnmEP6+n+aLH7BYuYCVA==",
|
"integrity": "sha512-GzBr7KM2TYWoJSlF3sVo1cMIOeyxgXpEdegXLZyYONRpunFHsBdKwOba0ki17kN2stLaEwTNolJChGHafqM7Fw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"babel-preset-es2015": "^6.22.0",
|
"babel-preset-es2015": "^6.22.0",
|
||||||
"babelify": "^7.3.0",
|
"babelify": "^7.3.0",
|
||||||
@ -21835,7 +21835,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"babelify": {
|
"babelify": {
|
||||||
"version": "7.3.0",
|
"version": "7.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/babelify/-/babelify-7.3.0.tgz",
|
"resolved": "http://registry.npmjs.org/babelify/-/babelify-7.3.0.tgz",
|
||||||
"integrity": "sha1-qlau3nBn/XvVSWZu4W3ChQh+iOU=",
|
"integrity": "sha1-qlau3nBn/XvVSWZu4W3ChQh+iOU=",
|
||||||
"requires": {
|
"requires": {
|
||||||
"babel-core": "^6.0.14",
|
"babel-core": "^6.0.14",
|
||||||
|
@ -169,7 +169,7 @@
|
|||||||
"multiplex": "^6.7.0",
|
"multiplex": "^6.7.0",
|
||||||
"number-to-bn": "^1.7.0",
|
"number-to-bn": "^1.7.0",
|
||||||
"obj-multiplex": "^1.0.0",
|
"obj-multiplex": "^1.0.0",
|
||||||
"obs-store": "^3.0.0",
|
"obs-store": "^3.0.2",
|
||||||
"percentile": "^1.2.0",
|
"percentile": "^1.2.0",
|
||||||
"pify": "^3.0.0",
|
"pify": "^3.0.0",
|
||||||
"ping-pong-stream": "^1.0.0",
|
"ping-pong-stream": "^1.0.0",
|
||||||
|
Loading…
Reference in New Issue
Block a user