c->pquery = 0;
xfree(c->cqlquery);
c->cqlquery = 0;
-
- ZOOM_resultset_destroy(c->resultset);
+ assert(!c->connection);
+ assert(!c->resultset);
+
yaz_mutex_destroy(&c->mutex);
xfree(c);
return 1;
void client_set_connection(struct client *cl, struct connection *con)
{
+ if (cl->resultset)
+ {
+ ZOOM_resultset_destroy(cl->resultset);
+ cl->resultset = 0;
+ }
if (con)
{
assert(cl->connection == 0);
static void session_remove_clients(struct session *se)
{
- struct client *cl = se->clients;
- while (cl)
- {
- struct client *cl_next = client_next_in_session(cl);
- client_remove_from_session(cl);
- client_destroy(cl);
- cl = cl_next;
- }
- se->clients = 0;
+ while (se->clients)
+ client_remove_from_session(se->clients);
}
// Associates a set of clients with a session;