Hi,
What is the right approach for handling command deactivation?
There seem to be different situations in FreeCAD when command can be deactivated:
- Command can be cancelled
- Command can be interrupted due to another command started
- Command can finish the work
- Probably some other situations...
When command is being deactivated, it is a good time to free some resources, acquired by the command. Like: event callbacks, selectionObserver, temporary objects.
How to write commands properly to avoid situations when some resources leak?
Many thanks
Execute cleanup code when the workbench command is deactivated
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
-
- Posts: 4
- Joined: Sun Jan 15, 2017 11:04 am