THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 15/11/2012 at 22:53, xxxxxxxx wrote:
I'm implementing the AskClose() method in a CommandData plugin and everything is working as expected. If I close the dialog window for the plugin, the method gets called and it does its job.
The problem I'm experiencing however, is that if you quit C4D from either the file->quit menu or just command + q (mac) while the plugin window is open, C4D crashes. Removing the AskClose() method solves the issue so it seems that this is where the problem stems from. It makes sense because once the dialog is gone, there is no AskClose method to call. At least that is my thinking. Even just having the method as a stubb with pass in it crashes the app.
Is there a way to detect when C4D is about to close and avoid calling the method? I tried using c4d.BFM_DESTROY in Message but could not get it to work. I'm at a loss on how to solve this.