Rhino exit handling?

hi there,
i need to handle the rhino user exit request for memory cleanup in C++,
any documentation where i can handle that event ?
my plugin work like charm but it does not handle that kind of even (rhino exit) which is quite bad…
thks for any help.

Hi @JulienPoivret,

I’m confused. Are you not cleaning up in class destructors? Perhaps we need more info?

– Dale

Hey hello Dale,
let’s tell us that we got a sort of linked list “array of address holding other address”
and things have to be deallocated chronologically in order to don’t break the link of address to deallocate is there a sort of event which tell hey i’m mr RhinoApp() and i’m about to quit … you have just two seconds to clean your super secure ultra sensitive mess and leave !
that would be awesome to have this emergency callback…

Hi @JulienPoivret,

If your linked list is tied to a document, then you’ll want to create a CRhinoEventWatcher derived class and override the CRhinoEventWatcher::OnCloseDocument virtual function, which is called when Rhino is closing a document.

If your linked list is not tied to a document, then you can override CRhinoEventWatcher::OnCloseRhino so as to be notified when Rhino is closing.

You can also just override either CRhinoPlugIn::OnSaveAllSettings or CRhinoPlugIn::OnUnloadPlugIn. See rhinoSdkPlugIn.h for details.

There should be sample of all the above in the Rhino SDK Samples repo on GitHub.

– Dale

look like what i’m looking for i will dig that tomorrow… and thank you Dale for the support as always lol but hey! you work at McNeel right ? :thinking:

image

1 Like