Hello,
I am watching a Revit API course and in one lesson he says that we should unsubscribe Onshutdown from the event that he created (document changed).
Can someone explain why this is necessary? If Revit is closed, it cannot longer run that code right?
Solved! Go to Solution.
Solved by ricaun. Go to Solution.
Yes, you should unsubscribe in the Onshutdown, that's a good practice.
Before Revit finishes closing every application Onshutdown is called and at this time Revit still running anything could happen.
And imagine if you could load/unload an application with Revit open. If you do not unsubscribe, the event gonna stay forever in Revit until you close.
With the AppLoader you can load/unload an application with Revit open, and here is why you should unsubscribe in the Onshutdown.
Can't find what you're looking for? Ask the community or share your knowledge.