Could someone please confirm if SetQuitHandler() works? And if so, when is it called?
1) Is it when a user presses

2) Will it be called when the calculator is switched off?
Or if you could comment on my problem:
I have an addin with a AddIn_main which has a while(1) with a GetKey(). The user, once he enters my addin, can get out of it by pressing

There is no explicit Quit/Exit from the addin - reason for doing this was to get around the SDK bug where if you returned from your AddIn_main, then the user had to click and go into another application before coming back to yours. So pressing

Now, the question: I'm creating a growabale, dynamic array of structures. I malloc() and realloc() whenever the array grows. I also free() when array elements are removed.
But when do I finally call free()? For the malloc() I did to create the array? Since my addin can't be 'exited from', do I need to bother about this free() at all?
Please help!
Thank you!