IpcMain.RemoveAllListeners(string) is not removing the listeners #447

Closed
opened 2026-01-29 16:39:52 +00:00 by claunia · 3 comments
Owner

Originally created by @LandinMartensIQ on GitHub (Jan 29, 2020).

Originally assigned to: @GregorBiswanger on GitHub.

  • Version: 7.30.2
  • Target: .Net Core 3.1

In the C# lib, IpcMain.RemoveAllListeners(string) is not removing the listeners. After executing this function, my event listeners are still firing.

Steps to Reproduce:

  1. Register a listener using IpcMain.On(channel_name)
  2. Wait for the event to be fired at least once from javascript
  3. Now in C# after the event, call `IpcMain.RemoveAllListeners(channel_name)
  4. Fire the event again within javascript
  5. The listener registered at step 1 still fires
Originally created by @LandinMartensIQ on GitHub (Jan 29, 2020). Originally assigned to: @GregorBiswanger on GitHub. * **Version**: 7.30.2 * **Target**: .Net Core 3.1 In the C# lib, `IpcMain.RemoveAllListeners(string)` is not removing the listeners. After executing this function, my event listeners are still firing. Steps to Reproduce: 1. Register a listener using `IpcMain.On(channel_name)` 2. Wait for the event to be fired at least once from javascript 3. Now in C# after the event, call `IpcMain.RemoveAllListeners(channel_name) 4. Fire the event again within javascript 5. The listener registered at step 1 still fires
claunia added the bug label 2026-01-29 16:39:52 +00:00
Author
Owner

@GregorBiswanger commented on GitHub (Apr 20, 2020):

I tested it with the current version and there were no problems. Possibly. your code will not be executed with RemoveAllListeners or it is due to the new Electron 8 version. Our latest update in version 8.31.1 will be released in the next few days.

ElectronRemoveAllListeners

@GregorBiswanger commented on GitHub (Apr 20, 2020): I tested it with the current version and there were no problems. Possibly. your code will not be executed with RemoveAllListeners or it is due to the new Electron 8 version. Our latest update in version 8.31.1 will be released in the next few days. ![ElectronRemoveAllListeners](https://user-images.githubusercontent.com/7336300/79753317-02570d00-8316-11ea-88d2-e48635a42d88.gif)
Author
Owner

@dlamon1 commented on GitHub (Dec 23, 2021):

Did you find a solution to your problem? I am having the same issue.

@dlamon1 commented on GitHub (Dec 23, 2021): Did you find a solution to your problem? I am having the same issue.
Author
Owner

@ghost commented on GitHub (Dec 31, 2021):

I have the same problem, I have electron and React and when you are using the app for a log time it becomes slow because the number of imports using ipc renderer. I tried to remove al listeners but it continues sending requests.

@ghost commented on GitHub (Dec 31, 2021): I have the same problem, I have electron and React and when you are using the app for a log time it becomes slow because the number of imports using ipc renderer. I tried to remove al listeners but it continues sending requests.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#447