mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-07 13:30:09 -05:00
protocol-native: improve client and resource refcounts
Add a refcount to resource and client so that we can keep them alive while the native protocol is using them. One problem might be that the protocol destroys the client or resource while handling it and that would cause errors. Fixes #565
This commit is contained in:
parent
383df85466
commit
19e3e20c47
5 changed files with 108 additions and 29 deletions
|
|
@ -308,6 +308,9 @@ struct pw_impl_client {
|
|||
unsigned int registered:1;
|
||||
unsigned int ucred_valid:1; /**< if the ucred member is valid */
|
||||
unsigned int busy:1;
|
||||
unsigned int destroyed:1;
|
||||
|
||||
int refcount;
|
||||
|
||||
/* v2 compatibility data */
|
||||
void *compat_v2;
|
||||
|
|
@ -945,8 +948,10 @@ struct pw_resource {
|
|||
const char *type; /**< type of the client interface */
|
||||
uint32_t version; /**< version of the client interface */
|
||||
uint32_t bound_id; /**< global id we are bound to */
|
||||
int refcount;
|
||||
|
||||
unsigned int removed:1; /**< resource was removed from server */
|
||||
unsigned int destroyed:1; /**< resource was destroyed */
|
||||
|
||||
struct spa_hook_list listener_list;
|
||||
struct spa_hook_list object_listener_list;
|
||||
|
|
@ -1266,6 +1271,8 @@ int pw_control_remove_link(struct pw_control_link *link);
|
|||
|
||||
void pw_control_destroy(struct pw_control *control);
|
||||
|
||||
void pw_impl_client_unref(struct pw_impl_client *client);
|
||||
|
||||
#define PW_LOG_OBJECT_POD (1<<0)
|
||||
void pw_log_log_object(enum spa_log_level level, const char *file, int line,
|
||||
const char *func, uint32_t flags, const void *object);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue