Quramy / electron-connect

Livereload tool for Electron
https://www.npmjs.com/package/electron-connect
340 stars 54 forks source link

reload() throws "Error: Object has been destroyed", with client.create() called from browser process. #49

Closed ssreekanth closed 8 years ago

ssreekanth commented 8 years ago

Steps to recreate the issue

  1. Using code from issue #45
  2. run gulp serve
  3. close one of the windows.
  4. Now, touch win1.html or touch win2.html to trigger electron-connect's server reload()

    Actual Result

Error: Object has been destroyed is seen on the console.

Error: Object has been destroyed
    at Error (native)
    at EventEmitter.<anonymous> (/Users/ssettipalli/Downloads/_personal_work/opensource/electron-connect/lib/client.js:114:21)
    at emitOne (events.js:101:20)
    at EventEmitter.emit (events.js:188:7)
    at EventEmitter.<anonymous> (/Users/ssettipalli/Downloads/_personal_work/opensource/electron-connect/lib/client.js:64:16)
    at emitTwo (events.js:106:13)
    at WebSocket.emit (events.js:191:7)
    at Receiver.ontext (/Users/ssettipalli/Downloads/_personal_work/opensource/electron-connect/node_modules/ws/lib/WebSocket.js:841:10)
    at /Users/ssettipalli/Downloads/_personal_work/opensource/electron-connect/node_modules/ws/lib/Receiver.js:536:18
    at /Users/ssettipalli/Downloads/_personal_work/opensource/electron-connect/node_modules/ws/lib/Receiver.js:368:7

Expected Result

Throws no error.