Fix memory leak where listeners are not being properly removed + add accompanying test.
Note about test: I've confirmed that the test for ipcMain failed before fix, but ipcRenderer reported 0 listeners via spectron even though I've confirmed by logging in the implementation that is not the case. Moreover, all the send channel listeners are definitely still registered (as they need to be explicitly removed).
I think spectron is to blame here, but I'm not sure as I'm not deeply familiar with electron altogether. Maybe both can't run in the right context in the same test?
Extracted as unrelated change from #31.
Fix memory leak where listeners are not being properly removed + add accompanying test.
Note about test: I've confirmed that the test for
ipcMain
failed before fix, butipcRenderer
reported 0 listeners viaspectron
even though I've confirmed by logging in the implementation that is not the case. Moreover, all the send channel listeners are definitely still registered (as they need to be explicitly removed).I think
spectron
is to blame here, but I'm not sure as I'm not deeply familiar withelectron
altogether. Maybe both can't run in the right context in the same test?