Changeset 5caad1d in mainline


Ignore:
Timestamp:
2025-06-20T18:59:58Z (10 hours ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
235bd1f, f0cc1c64
Parents:
cb20b05
Message:

tbarcfg_listener_destroy() should clean up properly.

Location:
uspace/lib/tbarcfg
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/tbarcfg/private/tbarcfg.h

    rcb20b05 r5caad1d  
    11/*
    2  * Copyright (c) 2024 Jiri Svoboda
     2 * Copyright (c) 2025 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    3939
    4040#include <adt/list.h>
     41#include <loc.h>
    4142#include <stdbool.h>
    4243#include <types/tbarcfg/tbarcfg.h>
     
    6869/** Taskbar configuration listener */
    6970typedef struct tbarcfg_listener {
     71        /** Async port */
     72        port_id_t portid;
     73        /** Registered server */
     74        loc_srv_t *srv;
     75        /** Registered service */
     76        service_id_t svcid;
    7077        /** Notification callback */
    7178        void (*cb)(void *);
  • uspace/lib/tbarcfg/src/tbarcfg.c

    rcb20b05 r5caad1d  
    671671                goto error;
    672672
     673        free(svcname);
     674        svcname = NULL;
     675
    673676        rc = loc_category_get_id(nchan, &catid, 0);
    674677        if (rc != EOK)
     
    679682                goto error;
    680683
     684        lst->portid = port;
     685        lst->srv = srv;
     686        lst->svcid = svcid;
    681687        *rlst = lst;
    682688        return EOK;
     
    699705void tbarcfg_listener_destroy(tbarcfg_listener_t *lst)
    700706{
     707        loc_service_unregister(lst->srv, lst->svcid);
     708        loc_server_unregister(lst->srv);
     709        async_port_destroy(lst->portid);
    701710        free(lst);
    702711}
Note: See TracChangeset for help on using the changeset viewer.