Changeset 7cc30e9 in mainline for uspace/srv/hid/display/window.c
- Timestamp:
- 2022-10-24T17:50:46Z (2 years ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 913add60
- Parents:
- 7a05d924
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/window.c
r7a05d924 r7cc30e9 44 44 #include <memgfx/memgc.h> 45 45 #include <stdlib.h> 46 #include <str.h> 46 47 #include "client.h" 47 48 #include "display.h" … … 81 82 wnd = calloc(1, sizeof(ds_window_t)); 82 83 if (wnd == NULL) { 84 rc = ENOMEM; 85 goto error; 86 } 87 88 wnd->caption = str_dup(params->caption); 89 if (wnd->caption == NULL) { 83 90 rc = ENOMEM; 84 91 goto error; … … 152 159 if (wnd->bitmap != NULL) 153 160 gfx_bitmap_destroy(wnd->bitmap); 161 if (wnd->caption != NULL) 162 free(wnd->caption); 154 163 free(wnd); 155 164 } … … 176 185 gfx_bitmap_destroy(wnd->bitmap); 177 186 187 free(wnd->caption); 178 188 free(wnd); 179 189 … … 902 912 * 903 913 * @param wnd Window 914 * @param cursor New cursor 904 915 * @return EOK on success, EINVAL if @a cursor is invalid 905 916 */ … … 915 926 } 916 927 928 /** Set window caption. 929 * 930 * @param wnd Window 931 * @param caption New caption 932 * 933 * @return EOK on success, EINVAL if @a cursor is invalid 934 */ 935 errno_t ds_window_set_caption(ds_window_t *wnd, const char *caption) 936 { 937 char *dcaption; 938 939 dcaption = str_dup(caption); 940 if (dcaption == NULL) 941 return ENOMEM; 942 943 free(wnd->caption); 944 wnd->caption = dcaption; 945 946 return EOK; 947 } 948 917 949 /** Window memory GC invalidate callback. 918 950 *
Note:
See TracChangeset
for help on using the changeset viewer.