]> sigrok.org Git - libsigrok.git/blobdiff - src/output/hex.c
output: Modules can keep track of option resources without wrapper help.
[libsigrok.git] / src / output / hex.c
index 428dd58494f09592a0a1e567f83791dd5ed07402..ab4ce2d37cbc3a485652010f6e9cf53d28c6fc4c 100644 (file)
@@ -261,13 +261,12 @@ static struct sr_option options[] = {
        { 0 }
 };
 
-static struct sr_option *get_options(gboolean cached)
+static struct sr_option *get_options(void)
 {
-       if (cached)
-               return options;
-
-       options[0].def = g_variant_new_uint32(DEFAULT_SAMPLES_PER_LINE);
-       g_variant_ref_sink(options[0].def);
+       if (!options[0].def) {
+               options[0].def = g_variant_new_uint32(DEFAULT_SAMPLES_PER_LINE);
+               g_variant_ref_sink(options[0].def);
+       }
 
        return options;
 }