Commit 99140272 authored by Richard W.M. Jones's avatar Richard W.M. Jones
Browse files

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
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment