aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ctl-lib/ctl-plugin.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ctl-lib/ctl-plugin.c b/ctl-lib/ctl-plugin.c
index 2bbae73..fd55e87 100644
--- a/ctl-lib/ctl-plugin.c
+++ b/ctl-lib/ctl-plugin.c
@@ -177,13 +177,14 @@ static int PluginLoadCOne(AFB_ApiT apiHandle, const char *pluginpath, json_objec
#endif
DispatchPluginInstallCbT ctlPluginOnload = dlsym(dlHandle, "CtlPluginOnload");
if (ctlPluginOnload) {
- ctlPlugin->api = apiHandle;
if((*ctlPluginOnload) (ctlPlugin, handle)) {
AFB_ApiError(apiHandle, "Plugin Onload function hasn't finish well. Abort initialization");
return -1;
}
}
+ ctlPlugin->api = apiHandle;
+
return 0;
}