]> sigrok.org Git - libsigrok.git/commitdiff
bindings/cxx: make sure the config value reference is kept
authorStefan Brüns <redacted>
Sat, 28 Nov 2015 22:18:50 +0000 (23:18 +0100)
committerUwe Hermann <redacted>
Fri, 4 Dec 2015 22:18:14 +0000 (23:18 +0100)
fixes glib warning:
GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed

bindings/cxx/classes.cpp

index 5cab6ac9919c4ff9249161f4decec004c21dea30..5eb3a750ddd14e2d12920ea7bd2839d306fd9a40 100644 (file)
@@ -1140,7 +1140,7 @@ map<const ConfigKey *, Glib::VariantBase> Meta::config() const
        map<const ConfigKey *, Glib::VariantBase> result;
        for (auto l = _structure->config; l; l = l->next) {
                auto *const config = static_cast<struct sr_config *>(l->data);
-               result[ConfigKey::get(config->key)] = Glib::VariantBase(config->data);
+               result[ConfigKey::get(config->key)] = Glib::VariantBase(config->data, true);
        }
        return result;
 }