Merge pull request #5228 from ConnorChristie/memory-leaks

Upgrade obs-store and fix memory leaks
feature/default_network_editable
Dan Finlay 6 years ago committed by GitHub
commit 9b3b70433e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      app/scripts/metamask-controller.js
  2. 8
      package-lock.json
  3. 2
      package.json

@ -177,7 +177,7 @@ module.exports = class MetamaskController extends EventEmitter {
blockTracker: this.blockTracker,
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) => {
if (status === 'confirmed' || status === 'failed') {
@ -1229,8 +1229,10 @@ module.exports = class MetamaskController extends EventEmitter {
)
dnode.on('remote', (remote) => {
// push updates to popup
const sendUpdate = remote.sendUpdate.bind(remote)
const sendUpdate = (update) => remote.sendUpdate(update)
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.
*/
setupPublicConfig (outStream) {
const configStream = asStream(this.publicConfigStore)
pump(
asStream(this.publicConfigStore),
configStream,
outStream,
(err) => {
configStream.destroy()
if (err) log.error(err)
}
)

8
package-lock.json generated

@ -21822,9 +21822,9 @@
}
},
"obs-store": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/obs-store/-/obs-store-3.0.0.tgz",
"integrity": "sha512-ZHK0fwDZEecEvdiqQGnxrEshbqibVgsq4aIIe/5PIT8fGGprTTuGw1RXLMy5G1VN/KtnmEP6+n+aLH7BYuYCVA==",
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/obs-store/-/obs-store-3.0.2.tgz",
"integrity": "sha512-GzBr7KM2TYWoJSlF3sVo1cMIOeyxgXpEdegXLZyYONRpunFHsBdKwOba0ki17kN2stLaEwTNolJChGHafqM7Fw==",
"requires": {
"babel-preset-es2015": "^6.22.0",
"babelify": "^7.3.0",
@ -21835,7 +21835,7 @@
"dependencies": {
"babelify": {
"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=",
"requires": {
"babel-core": "^6.0.14",

@ -169,7 +169,7 @@
"multiplex": "^6.7.0",
"number-to-bn": "^1.7.0",
"obj-multiplex": "^1.0.0",
"obs-store": "^3.0.0",
"obs-store": "^3.0.2",
"percentile": "^1.2.0",
"pify": "^3.0.0",
"ping-pong-stream": "^1.0.0",

Loading…
Cancel
Save