context: return -ENOENT for destroyed globals

Set the destroyed flag on globals and make sure they are not
available anymore during the signal emissions. One such instance
is where a global is destroyed, the resources are destroyed,
a waiting client is resumed, the clients asks to bind to the
global and causes an error.

See #298
This commit is contained in:
Wim Taymans 2020-11-19 11:34:44 +01:00
parent 908dc6b10f
commit 7434986452
4 changed files with 12 additions and 10 deletions

View file

@ -219,6 +219,9 @@ struct pw_global {
void *object; /**< object associated with the interface */
struct spa_list resource_list; /**< The list of resources of this global */
unsigned int registered:1;
unsigned int destroyed:1;
};
#define pw_core_resource(r,m,v,...) pw_resource_call(r, struct pw_core_events, m, v, ##__VA_ARGS__)