X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fdata%2Fdecode%2Fdecoder.cpp;h=6ce60da8559c96e1e81e7b4e974ba4a6d42874a5;hb=f228f00ed2c11ce4c9c36e0b758132a075e251da;hp=c6995bcf703a56cb13b4ba347acb2c61aa11d17e;hpb=8ce0e732cfe912e022eb96d06aaaa40390efcd6b;p=pulseview.git diff --git a/pv/data/decode/decoder.cpp b/pv/data/decode/decoder.cpp index c6995bc..6ce60da 100644 --- a/pv/data/decode/decoder.cpp +++ b/pv/data/decode/decoder.cpp @@ -91,8 +91,12 @@ void Decoder::set_option(const char *id, GVariant *value) GHashTable *const opt_hash = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, (GDestroyNotify)g_variant_unref); - g_variant_ref(value); - g_hash_table_insert(opt_hash, (void*)g_strdup(id), value); + for (const auto& option : options_) { + GVariant *const value = option.second; + g_variant_ref(value); + g_hash_table_replace(opt_hash, (void*)g_strdup( + option.first.c_str()), value); + } srd_inst_option_set(decoder_inst_, opt_hash); g_hash_table_destroy(opt_hash);