Changeset c6f00b40 in mainline for uspace/lib/ui/src/fixed.c


Ignore:
Timestamp:
2020-11-01T22:49:05Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4ac11ff
Parents:
4df6607
git-author:
Jiri Svoboda <jiri@…> (2020-11-01 22:47:03)
git-committer:
Jiri Svoboda <jiri@…> (2020-11-01 22:49:05)
Message:

Add virtual destructor for UI control

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ui/src/fixed.c

    r4df6607 rc6f00b40  
    6868void ui_fixed_destroy(ui_fixed_t *fixed)
    6969{
     70        ui_fixed_elem_t *elem;
     71        ui_control_t *control;
     72
    7073        if (fixed == NULL)
    7174                return;
    7275
    73         assert(list_empty(&fixed->elem));
     76        elem = ui_fixed_first(fixed);
     77        while (elem != NULL) {
     78                control = elem->control;
     79                ui_fixed_remove(fixed, control);
     80                ui_control_destroy(control);
     81
     82                elem = ui_fixed_first(fixed);
     83        }
     84
    7485        free(fixed);
    7586}
Note: See TracChangeset for help on using the changeset viewer.