How to reproduce:
$ G_SLICE=always-malloc G_DEBUG=gc-friendly valgrind --leak-check=full sigrok-cli --scan --driver demo
Signed-off-by: Marc Schink <redacted>
GHashTableIter iter;
void *value;
+ demo_free_analog_pattern(devc);
+
/* Analog generators. */
g_hash_table_iter_init(&iter, devc->ch_ag);
while (g_hash_table_iter_next(&iter, NULL, &value))
devc->analog_patterns[PATTERN_ANALOG_RANDOM] = pattern;
}
+SR_PRIV void demo_free_analog_pattern(struct dev_context *devc)
+{
+ g_free(devc->analog_patterns[PATTERN_SQUARE]);
+ g_free(devc->analog_patterns[PATTERN_SINE]);
+ g_free(devc->analog_patterns[PATTERN_TRIANGLE]);
+ g_free(devc->analog_patterns[PATTERN_SAWTOOTH]);
+ g_free(devc->analog_patterns[PATTERN_ANALOG_RANDOM]);
+}
+
static uint64_t encode_number_to_gray(uint64_t nr)
{
return nr ^ (nr >> 1);
};
SR_PRIV void demo_generate_analog_pattern(struct dev_context *devc);
+SR_PRIV void demo_free_analog_pattern(struct dev_context *devc);
SR_PRIV int demo_prepare_data(int fd, int revents, void *cb_data);
#endif