output: Fix output option enumeration.

This commit is contained in:
Bert Vermeulen 2014-08-18 23:54:46 +02:00
parent 34f4e3b4e4
commit 499c85dce5
1 changed files with 11 additions and 11 deletions

View File

@ -187,25 +187,25 @@ SR_API const struct sr_option **sr_output_options_get(const struct sr_output_mod
* *
* @since 0.4.0 * @since 0.4.0
*/ */
SR_API void sr_output_options_free(const struct sr_option **opts) SR_API void sr_output_options_free(const struct sr_option **options)
{ {
struct sr_option *opt; int i;
if (!opts) if (!options)
return; return;
for (opt = (struct sr_option *)opts[0]; opt; opt++) { for (i = 0; options[i]; i++) {
if (opt->def) { if (options[i]->def) {
g_variant_unref(opt->def); g_variant_unref(options[i]->def);
opt->def = NULL; ((struct sr_option *)options[i])->def = NULL;
} }
if (opt->values) { if (options[i]->values) {
g_slist_free_full(opt->values, (GDestroyNotify)g_variant_unref); g_slist_free_full(options[i]->values, (GDestroyNotify)g_variant_unref);
opt->values = NULL; ((struct sr_option *)options[i])->values = NULL;
} }
} }
g_free(opts); g_free(options);
} }
/** /**