schema tree BUGFIX apply destructor onto private data in extension instances
Use private_destructor function from context destructor (ly_ctx_destroy())
to free the private data stored in extension instances.
Fixes #307
diff --git a/src/libyang.h.in b/src/libyang.h.in
index cfa78b8..79c25fa 100644
--- a/src/libyang.h.in
+++ b/src/libyang.h.in
@@ -1380,6 +1380,8 @@
* @param[in] ctx libyang context to destroy
* @param[in] private_destructor Optional destructor function for private objects assigned
* to the nodes via lys_set_private(). If NULL, the private objects are not freed by libyang.
+ * Remember the differences between the structures derived from ::lys_node and always check
+ * ::lys_node#nodetype.
*/
void ly_ctx_destroy(struct ly_ctx *ctx, void (*private_destructor)(const struct lys_node *node, void *priv));