Hello.
The answer depends on how you are closing the application. Under normal circumstances, QuickOPC closes all open sessions properly, and you do not have to do anything special. If the session keeps "accumulating" on the server, something is wrong, and there are basically two options:
a) server bug,
b) client bug (including QuickOPC bug), or
c) client mishandling.
By "client mishandling", I mean unusual terminations of the client process. For example, if you are running your program under debugger, and use the "Stop" command to abruptly end the debugging. For myself, I do this quite commonly whenever I reach the point in the debugging which gives me enough information - so one needs to be careful not to do that if the session(s) should be closed. Or, if you use the Task Manager to kill process.
Note that even in this case, after some time the server should get rid of the session internally, and make the "slot" available for new sessions. But the time might be relatively long. It is usually configurable on the server side.
If you are not doing anything like that, the remaining options are a) server bug, and b) client bug. In order to tell which one is the case, it would be necessary to see the communication between the client and the server, and check whether the client is properly closing the session or not. You will need Wireshark for that - see
kb.opclabs.com/Collecting_information_for_troubleshooting .
Best regards