]> sigrok.org Git - libsigrok.git/blobdiff - src/output/bits.c
output: Modules can keep track of option resources without wrapper help.
[libsigrok.git] / src / output / bits.c
index e9eace0793702f7b8d531426767e40403f540329..22212fd5cd205c088884ce396be49882ada6c4f2 100644 (file)
@@ -246,13 +246,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;
 }