We can't touch the memory in the destroy handler, since it could
already have been freed. Just always leave the freeing of option
memory to the destructors.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
{
struct gopt_str *s = (struct gopt_str *) data;
{
struct gopt_str *s = (struct gopt_str *) data;
- if (flist_empty(&s->gopt.changed_list))
- free(s);
-
{
struct gopt_combo *c = (struct gopt_combo *) data;
{
struct gopt_combo *c = (struct gopt_combo *) data;
- if (flist_empty(&c->gopt.changed_list))
- free(c);
-
{
struct gopt_int *i = (struct gopt_int *) data;
{
struct gopt_int *i = (struct gopt_int *) data;
- if (flist_empty(&i->gopt.changed_list))
- free(i);
-
{
struct gopt_bool *b = (struct gopt_bool *) data;
{
struct gopt_bool *b = (struct gopt_bool *) data;
- if (flist_empty(&b->gopt.changed_list))
- free(b);
-
{
struct gopt_range *r = (struct gopt_range *) data;
{
struct gopt_range *r = (struct gopt_range *) data;
- if (flist_empty(&r->gopt.changed_list))
- free(r);
-
{
struct gopt_str_val *g = (struct gopt_str_val *) data;
{
struct gopt_str_val *g = (struct gopt_str_val *) data;
- if (flist_empty(&g->gopt.changed_list))
- free(g);
-
{
struct fio_option *o = &fio_options[gopt->opt_index];
struct gopt_job_view *gjv = gopt->gjv;
{
struct fio_option *o = &fio_options[gopt->opt_index];
struct gopt_job_view *gjv = gopt->gjv;
switch (gopt->opt_type) {
case GOPT_COMBO_INT: {
switch (gopt->opt_type) {
case GOPT_COMBO_INT: {
c = container_of(gopt, struct gopt_combo, gopt);
gopt_handle_combo_int_changed(gjv, c, o);
c = container_of(gopt, struct gopt_combo, gopt);
gopt_handle_combo_int_changed(gjv, c, o);
break;
}
case GOPT_COMBO_STR: {
break;
}
case GOPT_COMBO_STR: {
c = container_of(gopt, struct gopt_combo, gopt);
gopt_handle_combo_str_changed(gjv, c, o);
c = container_of(gopt, struct gopt_combo, gopt);
gopt_handle_combo_str_changed(gjv, c, o);
break;
}
case GOPT_INT: {
break;
}
case GOPT_INT: {
i = container_of(gopt, struct gopt_int, gopt);
gopt_handle_int_changed(gjv, i, o);
i = container_of(gopt, struct gopt_int, gopt);
gopt_handle_int_changed(gjv, i, o);
break;
}
case GOPT_BOOL: {
break;
}
case GOPT_BOOL: {
b = container_of(gopt, struct gopt_bool, gopt);
gopt_handle_bool_changed(gjv, b, o);
b = container_of(gopt, struct gopt_bool, gopt);
gopt_handle_bool_changed(gjv, b, o);
break;
}
case GOPT_STR: {
break;
}
case GOPT_STR: {
s = container_of(gopt, struct gopt_str, gopt);
gopt_handle_str_changed(gjv, s, o);
s = container_of(gopt, struct gopt_str, gopt);
gopt_handle_str_changed(gjv, s, o);
break;
}
case GOPT_STR_VAL: {
break;
}
case GOPT_STR_VAL: {
s = container_of(gopt, struct gopt_str_val, gopt);
gopt_handle_str_val_changed(gjv, s, o);
s = container_of(gopt, struct gopt_str_val, gopt);
gopt_handle_str_val_changed(gjv, s, o);
break;
}
case GOPT_RANGE: {
break;
}
case GOPT_RANGE: {
r = container_of(gopt, struct gopt_range, gopt);
gopt_handle_range_changed(gjv, r, o);
r = container_of(gopt, struct gopt_range, gopt);
gopt_handle_range_changed(gjv, r, o);
break;
}
case GOPT_STR_MULTI: {
break;
}
case GOPT_STR_MULTI: {
m = container_of(gopt, struct gopt_str_multi, gopt);
gopt_handle_str_multi_changed(gjv, m, o);
m = container_of(gopt, struct gopt_str_multi, gopt);
gopt_handle_str_multi_changed(gjv, m, o);
}
g_object_unref(G_OBJECT(gopt->box));
}
g_object_unref(G_OBJECT(gopt->box));
}
static void gopt_handle_changed_options(struct gopt_job_view *gjv)
}
static void gopt_handle_changed_options(struct gopt_job_view *gjv)