From 4a72073d15248dbb3c9d88377405ad44e75f6d1b Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Mon, 9 Jul 2018 17:47:25 +0200 Subject: Fix: plugin api assignement order There was an issue because the assignement happens after the onLoad call. Change-Id: I97dc65ad2a14a6e72bb2f59bc443d9fc5779abee Signed-off-by: Romain Forlot --- ctl-lib/ctl-plugin.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'ctl-lib') diff --git a/ctl-lib/ctl-plugin.c b/ctl-lib/ctl-plugin.c index f36c82c..16b2056 100644 --- a/ctl-lib/ctl-plugin.c +++ b/ctl-lib/ctl-plugin.c @@ -175,6 +175,7 @@ static int PluginLoadCOne(AFB_ApiT apiHandle, const char *pluginpath, json_objec LuaL2cNewLib(ctlPlugin->ctlL2cFunc->l2cFunc, ctlPlugin->ctlL2cFunc->l2cCount, ctlPlugin->ctlL2cFunc->prefix); } #endif + ctlPlugin->api = apiHandle; DispatchPluginInstallCbT ctlPluginOnload = dlsym(dlHandle, "CtlPluginOnload"); if (ctlPluginOnload) { if((*ctlPluginOnload) (ctlPlugin, handle)) { @@ -183,8 +184,6 @@ static int PluginLoadCOne(AFB_ApiT apiHandle, const char *pluginpath, json_objec } } - ctlPlugin->api = apiHandle; - return 0; } -- cgit 1.2.3-korg