extensions BUGFIX plugins refcount maintenance
increase refcount only in case the context being created is successfully
created and returned from ly_ctx_new().
diff --git a/src/context.c b/src/context.c
index 49ab2c2..4305907 100644
--- a/src/context.c
+++ b/src/context.c
@@ -78,7 +78,6 @@
lydict_init(&ctx->dict);
/* plugins */
- ext_plugins_ref++;
lyext_load_plugins();
/* models list */
@@ -88,6 +87,7 @@
free(ctx);
return NULL;
}
+ ext_plugins_ref++;
ctx->models.used = 0;
ctx->models.size = 16;
if (search_dir) {