- fix
[oweals/gnunet.git] / src / util / server_nc.c
index f6b0d8e22f4c62583f37e3c8068d1ec00fda5706..7a96dd6efd527c1c14159f339cfb944cfac64d5b 100644 (file)
@@ -201,7 +201,7 @@ handle_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client)
  * @param server server for which this function creates the context
  * @param queue_length maximum number of messages to keep in
  *        the notification queue; optional messages are dropped
- *        it the queue gets longer than this number of messages
+ *        if the queue gets longer than this number of messages
  * @return handle to the notification context
  */
 struct GNUNET_SERVER_NotificationContext *
@@ -236,6 +236,11 @@ GNUNET_SERVER_notification_context_destroy (struct
     GNUNET_CONTAINER_DLL_remove (nc->clients_head,
                                 nc->clients_tail,
                                 pos);
+    if (NULL != pos->th)
+    {
+      GNUNET_SERVER_notify_transmit_ready_cancel(pos->th);
+      pos->th = NULL;
+    }
     GNUNET_SERVER_client_drop (pos->client);
     while (NULL != (pml = pos->pending_head))
     {