ocaml: Call caml_shutdown when unloading the plugin
This has several useful effects (taken from the OCaml documentation): * Running the functions that were registered with "Stdlib.at_exit". * Triggering finalization of allocated custom blocks. For example, "Stdlib.in_channel" and "Stdlib.out_channel" are represented by custom blocks that enclose file descriptors, which are to be released. * Unloading the dependent shared libraries that were loaded by the runtime, including "dynlink" plugins. * Freeing the memory blocks that were allocated by the runtime with "malloc". If the function is not present (for OCaml < 4.05) then we just skip this step.
parent
745a0f13