+ // If application add a handle let's free it now
+ if (client->contexts != NULL) {
+
+ // Free client handle with a standard Free function, with app callback or ignore it
+ for (idx=0; client->plugins[idx] != NULL; idx ++) {
+ if (client->contexts[idx] != NULL) {
+ freeCtxCB = client->plugins[idx]->freeCtxCB;
+ if (freeCtxCB == NULL) free (client->contexts[idx]);
+ else if (freeCtxCB != (void*)-1) freeCtxCB(client->contexts[idx], plugins[idx]->handle, client->uuid);
+ }
+ }
+ }
+}
+
+// Create a new store in RAM, not that is too small it will be automatically extended
+PUBLIC void ctxStoreInit (int nbSession) {
+ int res;
+
+ // let's create as store as hashtable does not have any
+ sessions.store = calloc (nbSession+1, sizeof(AFB_clientCtx));
+ sessions.max=nbSession;