X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Foutput%2Fanalog.c;h=d665b8ec2edaa81182adc50387b0538d6dc70dfe;hb=f5c697bfe6d80c95051eaa1f52e1fefb54effa97;hp=6632cda68844fc631e8ac1143af6dd2b7119e5ab;hpb=cd1e7fd20dde8475ab766425c352f8ad4247747c;p=libsigrok.git diff --git a/src/output/analog.c b/src/output/analog.c index 6632cda6..d665b8ec 100644 --- a/src/output/analog.c +++ b/src/output/analog.c @@ -118,6 +118,9 @@ static int receive(const struct sr_output *o, const struct sr_datafeed_packet *p g_string_append_printf(*out, "%" G_GUINT64_FORMAT, g_variant_get_uint64(src->data)); + } else if (srci->datatype == SR_T_STRING) { + g_string_append_printf(*out, "%s", + g_variant_get_string(src->data, NULL)); } g_string_append(*out, "\n"); } @@ -192,8 +195,14 @@ static int cleanup(struct sr_output *o) ctx = o->priv; g_ptr_array_free(ctx->channellist, 1); - g_variant_unref(options[0].def); - g_slist_free_full(options[0].values, (GDestroyNotify)g_variant_unref); + if (options[0].def) { + g_variant_unref(options[0].def); + options[0].def = NULL; + } + if (options[0].values) { + g_slist_free_full(options[0].values, (GDestroyNotify)g_variant_unref); + options[0].values = NULL; + } g_free(ctx->fdata); g_free(ctx); o->priv = NULL;