Articy Forum


https://www.articy.com:443/forum/

Quitting Application

https://www.articy.com:443/forum/viewtopic.php?f=47&t=18290

Page 1 of 1

Quitting Application

Posted: Tue 28. Nov 2017, 12:13
by Julen
¿Is there any way of Quitting the application / Destroying plugin when there is an error?
I create a gigantic dictionary of data and I'd like to free the memory if there is any error since the plugin won't be usable.

Re: Quitting Application

Posted: Tue 28. Nov 2017, 17:42
by [Articy] Peter Sabath
Hi Julen,

Since C# is garbage collected you might just set your reference to the dictionary to null so its memory can be collected.

You can return any non null String from the Initialize() method of the plugin if the initializer has detected an error condition and the plugin should deactivate itself.

It is good practice to hook the ProjectUnloading method to free resources when a project is closed.

The Deinitialize() method is called when articy:draft is closed, but once a plugin (and its assembly) is loaded it remains in memory and its instance might be reused. This behavior can be used to initialize static information only once.

There is a FatalExit method available but this will result in a crash packet and data loss if the data is not already saved and quits articy:draft
Code: Select all
Articy.Utils.Manifests.ApplicationManifest.FatalExit( Exception aException )

Re: Quitting Application

Posted: Wed 29. Nov 2017, 05:59
by Julen
Thank you so much! :D

All times are UTC
Page 1 of 1