The Generic Destroy Instance Action

	#include "ofxCore.h"
	#define kOfxActionDestroyInstance       "OfxActionDestroyInstance" 

  • handle handle to the plug-in instance, cast to an OfxImageEffectHandle
  • inArgs is redundant and is set to NULL,
  • outArgs is redundant and is set to NULL.


This action is the last passed to a plug-in's instance before its destruction. It is there to allow a plugin to destroy any per-instance data structures it may have created.


  • kOfxActionCreateInstance has been called on the handle,
  • the instance has not had any of its members destroyed yet,


  • the instance pointer is no longer valid and any operation on it will be undefined

Return Values

To some extent, what is returned is moot, a bit like throwing an exception in a C++ destructor, so the host should continue destruction of the instance regardless. However...

  • kOfxStatOK, the action was trapped and all was well,
  • OfxStatReplyDefault, the action was ignored as the effect had nothing to do,
  • kOfxStatErrFatal,
  • kOfxStatFailed, something went wrong, but no error code appropriate, the plugin should to post a message.