+static void
+cleanup_exploratory_stats (struct examine *cmd)
+{
+ int i;
+ for (i = 0; i < cmd->n_iacts; ++i)
+ {
+ int v;
+ const size_t n_cats = categoricals_n_count (cmd->cats, i);
+
+ for (v = 0; v < cmd->n_dep_vars; ++v)
+ {
+ int grp;
+ for (grp = 0; grp < n_cats; ++grp)
+ {
+ int q;
+ const struct exploratory_stats *es =
+ categoricals_get_user_data_by_category_real (cmd->cats, i, grp);
+
+ struct order_stats *os = es[v].hinges;
+ struct statistic *stat = &os->parent;
+ stat->destroy (stat);
+
+ for (q = 0; q < 3 ; q++)
+ {
+ os = es[v].quartiles[q];
+ stat = &os->parent;
+ stat->destroy (stat);
+ }
+
+ for (q = 0; q < cmd->n_percentiles ; q++)
+ {
+ os = es[v].percentiles[q];
+ stat = &os->parent;
+ stat->destroy (stat);
+ }
+
+ os = es[v].trimmed_mean;
+ stat = &os->parent;
+ stat->destroy (stat);
+
+ os = es[v].np;
+ if (os)
+ {
+ stat = &os->parent;
+ stat->destroy (stat);
+ }
+
+ os = es[v].histogram;
+ if (os)
+ {
+ stat = &os->parent;
+ stat->destroy (stat);
+ }
+
+ moments_destroy (es[v].mom);
+
+ casereader_destroy (es[v].sorted_reader);
+ }
+ }
+ }
+}
+
+