]> sigrok.org Git - libsigrok.git/blobdiff - src/output/ascii.c
output: Modules can keep track of option resources without wrapper help.
[libsigrok.git] / src / output / ascii.c
index 4d97479ce8c70c883f2434dc18be422e20c06c0e..45abb656447433a01e6ecc65d08ceeccb5971280 100644 (file)
@@ -260,13 +260,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;
 }