#include <config.h>
#include "vfm.h"
#include "vfmP.h"
-#include <assert.h>
+#include "error.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
/* Old data sink becomes new data source. */
if (vfm_sink->class->make_source != NULL)
vfm_source = vfm_sink->class->make_source (vfm_sink);
- else
- vfm_source = NULL;
+ else
+ {
+ if (vfm_sink->class->destroy != NULL)
+ vfm_sink->class->destroy (vfm_sink);
+ vfm_source = NULL;
+ }
free_case_sink (vfm_sink);
vfm_sink = NULL;
else
{
info->mode = MEMORY;
- info->max_cases = (set_max_workspace
+ info->max_cases = (get_max_workspace()
/ (sizeof (struct case_list) + info->case_size));
}
}
workspace_overflow = 1;
msg (MW, _("Workspace limit of %d KB (%d cases at %d bytes each) "
"overflowed. Writing active file to disk."),
- set_max_workspace / 1024, info->max_cases,
+ get_max_workspace() / 1024, info->max_cases,
sizeof (struct case_list) + info->case_size);
storage_to_disk (info, sink->value_cnt);