* @param timeout after how long should we give up (and call
* notify with buf NULL and size 0)?
* @param cont continuation to call when done (can be NULL)
+ * This callback CANNOT destroy the statistics handle in the same call.
* @param proc function to call on each value
* @param cls closure for proc and cont
* @return NULL on error
* @param timeout after how long should we give up (and call
* cont with an error code)?
* @param cont continuation to call when done (can be NULL)
+ * This callback CANNOT destroy the statistics handle in the same call.
* @param proc function to call on each value
* @param cls closure for cont and proc
* @return NULL on error
subsystem, name, value, is_persistent);
}
+
+/**
+ * We don't need the statistics handle anymore, destroy it.
+ *
+ * @param cls Closure (the statistics handle to destroy)
+ * @param tc Task Context
+ */
+static void
+internal_destroy_statistics (void *cls, GNUNET_SCHEDULER_TaskContext *tc)
+{
+ struct GNUNET_STATISTICS_Handle *h = cls;
+
+ GNUNET_STATISTICS_destroy (h, GNUNET_NO);
+}
+
+
/**
* Internal continuation call for statistics iteration.
*
}
if (core_context->stats_handle != NULL)
- GNUNET_STATISTICS_destroy (core_context->stats_handle, GNUNET_NO);
+ /* Cannot destroy handle inside the continuation */
+ GNUNET_SCHEDULER_add_now (&internal_destroy_statistics,
+ core_context->stats_handle);
GNUNET_free (core_context);
}
struct OutstandingSSH *pos;
pos = pg->ssh_head;
- while ((pos != NULL) && (strcmp (pos->hostname, hostname) != 0))
+ while ((NULL != pos) && (strcmp (pos->hostname, hostname) != 0))
pos = pos->next;
- GNUNET_assert (pos != NULL);
+ GNUNET_assert (NULL != pos);
pos->outstanding++;
}