schema CHANGE hide schema compilation behing lys_parse_mem()
Call lys_compile() automatically when the schema is being inserted into
the context to avoid requirement on user to call it separately.
diff --git a/src/tree_schema_helpers.c b/src/tree_schema_helpers.c
index 37a65c2..692acaa 100644
--- a/src/tree_schema_helpers.c
+++ b/src/tree_schema_helpers.c
@@ -712,6 +712,11 @@
if (module_data_free) {
module_data_free((void*)module_data, ctx->imp_clb_data);
}
+ if (*mod && implement && lys_compile(*mod, 0)) {
+ ly_set_rm(&ctx->list, *mod, NULL);
+ lys_module_free(*mod, NULL);
+ *mod = NULL;
+ }
}
}
if (!(*mod) && !(ctx->flags & LY_CTX_PREFER_SEARCHDIRS)) {