The cleanup() routine gets invoked upon shutdown, as well as before
re-importing another file. The cleanup() routine must not release
resources which get allocated in the init() routine, as the init()
routine won't run again in the module's lifetime. The cleanup() routine
must void those context fields which get evaluated in the next receive()
calls.
inc = in->priv;
- if (inc->delimiter)
- g_string_free(inc->delimiter, TRUE);
-
- if (inc->comment)
- g_string_free(inc->comment, TRUE);
-
g_free(inc->termination);
+ inc->termination = NULL;
g_free(inc->datafeed_buffer);
+ inc->datafeed_buffer = NULL;
}
static int reset(struct sr_input *in)