Hi all,
I was hoping someone can point me to the correct function I should use to setup a cleanup function.
I have an external function that I setup using the standard DefineFunction call. But I also want to setup a callback to do some cleaning up when CLIPS exits.
I've tried both AddCleanupFunction and AddEnvironmentCleanupFunction but neither function seem to be the one I want. Firstly, the external function I setup doesn't need to be environment aware yet both the above cleanup functions require an environment parameter. To get around this I use the GetCurrentEnvironment function to get the current environment, which when called from UserFunctions isn't NULL so presumably is the right thing to do.
In any case, when I setup my callback with AddCleanupFunction the cleanup function is called straight away (and not on CLIPS exit). This is definitely not what I want :). On the other hand using AddEnvironmentCleanupFunction the callback seems to never get called.
All of which leaves me a bit lost as to what I should do to setup a cleanup function. Any thoughts?
Regards,
Dave R.