Closed bondtrade closed 4 years ago
This is a bit strange ... do you have a simple piece of code that reproduces this?
In general, always call delete
on the event listeners and their handles. You have to make sure to keep track of listener handles for clean up. Make sure classes implement delete
which is called on objects when they go out of scope. In this delete function you should call delete on listener handles etc. You can see good example of this in +TWS/Session.m
.
If you call clear all
in the command window this will clear absolutely everything which would hopefully (at least) alleviate the need to restart.
Thanks Abel. Worked like a charm! Much appreciated. 👍
Hi Abel, After I create a session to connect to TWS, pass the session variable/class around to several other classes, and perform a clean deletion of those session variables and listeners, if I run the routines again their seems to be a legacy connection and listeners such that I receive two events for everything. I handle this by restarting MATLAB but it's slowing development time down considerably. Is there a magic bullet method to sever all ties to TWS and start over clean without restarting MATLAB? Cheers.