event Handlers not being released
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I've been experiencing issues with F360's integration with VSC ever since Spyder was replaced. I've also been having ongoing PM conversations with @goyals for the last 9 months and I was hopeful that the new debugger release in September would have resolved the issue, but it still lingers.
The issue is that while debugging and frequently after an error is found, particularly with a hierarchy of python modules and more particularly when creating and debugging event handlers, the event handlers do not get deleted as expected when refreshing the code. I would surmise that something is keeping a reference to handler objects, such that garbage collection doesn't see that the handlers have been released.
When this happens you get multiple calls to the same handler, and it is obvious that older versions of the handler are not removed. If the handler code is altered (as would happen if you find a bug) it is clear that VSC still has a link to the old handler code version, and single step tracing follows the old code lines. For example Variables you expect to have corrected values, still behave as if nothing has changed. Attempts to actively delete or clear previous handlers fail (if reference pointers are still available). So, in the immediate debugging command line entering
event.remove(handler) --> results in True
no matter how many times you execute this. If the handler was actually removed, it should result in "False" the next time this command is invoked. This may happen to be a quirk of the VSC/F360 API interface, but it's symptomatic of the underlying issue.
Unfortunately when this this issue arises it is persistent and it's impossible to clear the old handlers, even after breaking the link to the code in VSC, stopping the process under Tools-|Add-ins|Scripts and Add-Ins and then closing down VSC. Restarting VSC and the debugging session from fresh does not clear the issue - the only way is to shut down and restart F360.
Shyam implied that the F360 team was working on this, but I now guess he's on a different project. I would consider this to be a significant and major bug and makes working on anything reasonably significant very challenging (I was tempted to use less polite words, but I think you get the point).
I am happy to help and work with you guys/gals, because it's time this was resolved.
Regards
Peter
Life long R&D Engineer (retired after 30+ years in Military Communications, Aerospace Robotics and Transport Automation).