Removed #if0 around check for live connections -- reinstating WATCH execution for...
[pazpar2-moved-to-github.git] / src / client.c
index 064754a..2113f9d 100644 (file)
@@ -139,14 +139,12 @@ void client_set_state(struct client *cl, enum client_state st)
     cl->state = st;
     /* no need to check for all client being non-active if this one
        already is. Note that session_active_clients also LOCKS session */
-#if 0
     if (!client_is_active(cl) && cl->session)
     {
         int no_active = session_active_clients(cl->session);
         if (no_active == 0)
             session_alert_watch(cl->session, SESSION_WATCH_SHOW);
     }
-#endif
 }
 
 static void client_show_raw_error(struct client *cl, const char *addinfo);
@@ -655,8 +653,11 @@ int client_destroy(struct client *c)
             xfree(c->cqlquery);
             c->cqlquery = 0;
             assert(!c->connection);
-            assert(!c->resultset);
-            
+
+            if (c->resultset)
+            {
+                ZOOM_resultset_destroy(c->resultset);
+            }
             yaz_mutex_destroy(&c->mutex);
             xfree(c);
             client_use(-1);
@@ -669,10 +670,7 @@ int client_destroy(struct client *c)
 void client_set_connection(struct client *cl, struct connection *con)
 {
     if (cl->resultset)
-    {
-        ZOOM_resultset_destroy(cl->resultset);
-        cl->resultset = 0;
-    }
+        ZOOM_resultset_release(cl->resultset);
     if (con)
     {
         assert(cl->connection == 0);