Closed jensstigaard closed 4 years ago
Nevermind!
I just read the sentence in the readme: "The receiver instance will disconnect on the next garbage collection, so make sure that you don't hold onto a reference."
I used Electron, and I did not were aware that you could manually trigger garbage collection. https://stackoverflow.com/questions/51372010/enabling-manual-garbage-collection-in-electron-app
What is the procedure of closing/releasing receivers?
I have tested with the NDI Signal generator, and when switching between receiving sources, the number of connections grows - the receivers are not released.
How to reproduce: Create new receiver to Receive Source 1. (Signal generator) Create new receiver to Receive Source 2. (Other source) Create new receiver to Receive Source 1. (Signal generator)
The number of connections on the Signal generator now says 2, and will grow to 3 if I switch to another source and back to the signal generator.
I use the same variable to hold the reference to the receiver, and it is being overwritten each time the receiver is created successfully.
I see there is a finalizeReceive method in grandiose_receive.cc, but I does not see when it is used...
Best regards