Destructor routine for a json_value pointer.
This must be called explicitly if it is no longer needed,
before it goes out of scope. Otherwise, a memory leak will result.
Example
Destroy the json_value pointer before the variable goes out of scope:
Note: it should NOT be called for a json_value pointer than has already been
added to another json_value structure, since doing so may render the
other structure invalid. Consider the following example:
subroutine example2(p)type(json_value),pointer,intent(out)::ptype(json_value),pointer::qcall json_create_object(p,'')call json_add(p,'year',2015)call json_create_object(q,'q')call json_add(q,'val',1)call json_add(p,q)!add q to p structure! do NOT call json_destroy(q) here, because q is! now part of the output structure p. p should be destroyed! somewhere upstream by the caller of this routine.nullify(q)!OK, but not strictly necessaryend subroutine example2
Nodes of different colours represent the following:
Module Graph
Solid arrows point from a parent (sub)module to the submodule which is
descended from it. Dashed arrows point from a module being used to the
module using it.
Type Graph
Solid arrows point from one derived type to another which extends
(inherits from) it. Dashed arrows point from a derived type to another
type containing it as a components, with a label listing the name(s) of
said component(s).
Call Graph
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Nodes of different colours represent the following:
Module Graph
Solid arrows point from a parent (sub)module to the submodule which is
descended from it. Dashed arrows point from a module being used to the
module using it.
Type Graph
Solid arrows point from one derived type to another which extends
(inherits from) it. Dashed arrows point from a derived type to another
type containing it as a components, with a label listing the name(s) of
said component(s).
Call Graph
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.