Changeset da412547 in mainline
- Timestamp:
- 2019-11-10T17:07:44Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b093a62
- Parents:
- 6427f083
- Location:
- uspace/srv/hid/display
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/client.c
r6427f083 rda412547 75 75 void ds_client_destroy(ds_client_t *client) 76 76 { 77 ds_window_t *window; 78 79 window = ds_client_first_window(client); 80 while (window != NULL) { 81 ds_window_destroy(window); 82 window = ds_client_first_window(client); 83 } 84 77 85 assert(list_empty(&client->windows)); 78 86 ds_display_remove_client(client); -
uspace/srv/hid/display/test/client.c
r6427f083 rda412547 203 203 } 204 204 205 /** Test client being destroyed while still having a window. 206 * 207 * This can happen if client forgets to destroy window or if the client 208 * is disconnected (or terminated). 209 */ 210 PCUT_TEST(client_leftover_window) 211 { 212 ds_display_t *disp; 213 ds_client_t *client; 214 ds_window_t *wnd; 215 errno_t rc; 216 217 rc = ds_display_create(NULL, &disp); 218 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 219 220 rc = ds_client_create(disp, NULL, NULL, &client); 221 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 222 223 rc = ds_window_create(client, &wnd); 224 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 225 226 ds_client_destroy(client); 227 ds_display_destroy(disp); 228 } 229 205 230 PCUT_EXPORT(client); -
uspace/srv/hid/display/window.c
r6427f083 rda412547 220 220 * @param wnd Window GC 221 221 */ 222 errno_t ds_window_destroy(ds_window_t *wnd) 223 { 224 errno_t rc; 225 222 void ds_window_destroy(ds_window_t *wnd) 223 { 226 224 ds_client_remove_window(wnd); 227 228 rc = gfx_context_delete(wnd->gc); 229 if (rc != EOK) 230 return rc; 225 (void) gfx_context_delete(wnd->gc); 231 226 232 227 free(wnd); 233 return EOK;234 228 } 235 229 -
uspace/srv/hid/display/window.h
r6427f083 rda412547 47 47 48 48 extern errno_t ds_window_create(ds_client_t *, ds_window_t **); 49 extern errno_tds_window_destroy(ds_window_t *);49 extern void ds_window_destroy(ds_window_t *); 50 50 extern gfx_context_t *ds_window_get_ctx(ds_window_t *); 51 51
Note:
See TracChangeset
for help on using the changeset viewer.