5.6 Destruction

Once you have finished with a fz_context (either your original one, or a ‘cloned’ one) you can destroy it using fz_drop_context.

/* 
   fz_drop_context: Free a context and its global state. 
 
   The context and all of its global state is freed, and any 
   buffered warnings are flushed (see fz_flush_warnings). If NULL 
   is passed in nothing will happen. 
 
   Does not throw exceptions. 
*/ 
void fz_drop_context(fz_context *ctx);

For example:

fz_drop_context(ctx);