Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset fc4abca in mainline


Ignore:
Timestamp:
2020-07-04T22:32:04Z (5 weeks ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
d74a2b8, e37378be
Parents:
fd11144
Message:

IPC GC server needs to destroy all lingering bitmaps

The client could exit without destroying all bitmaps in case it is
misbehaving or if it crashed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ipcgfx/src/server.c

    rfd11144 rfc4abca  
    331331{
    332332        ipc_gc_srv_t srvgc;
     333        ipc_gc_srv_bitmap_t *bitmap;
     334        link_t *link;
    333335
    334336        /* Accept the connection */
     
    375377        }
    376378
    377         // TODO: Destroy all remaining bitmaps (+ emit warning?)
     379        /*
     380         * Destroy all remaining bitmaps. A client should destroy all
     381         * the bitmaps before closing connection. But it could happen
     382         * that the client is misbehaving or was abruptly disconnected
     383         * (e.g. crashed).
     384         */
     385        link = list_first(&srvgc.bitmaps);
     386        while (link != NULL) {
     387                bitmap = list_get_instance(link, ipc_gc_srv_bitmap_t,
     388                    lbitmaps);
     389
     390                (void) gfx_bitmap_destroy(bitmap->bmp);
     391                if (bitmap->myalloc)
     392                        as_area_destroy(bitmap->pixels);
     393                list_remove(&bitmap->lbitmaps);
     394                free(bitmap);
     395
     396                link = list_first(&srvgc.bitmaps);
     397        }
     398
    378399        return EOK;
    379400}
Note: See TracChangeset for help on using the changeset viewer.