- if (client->plugin->freeCtxCB == NULL) free (client->ctx);
- else if (client->plugin->freeCtxCB != (void*)-1) client->plugin->freeCtxCB(client);
+ 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);
+ }
+ }