diff --git a/common/JackEngine.cpp b/common/JackEngine.cpp index e3bf7992..7d721ebd 100644 --- a/common/JackEngine.cpp +++ b/common/JackEngine.cpp @@ -773,11 +773,12 @@ int JackEngine::ClientCloseAux(int refnum, bool wait) } } - fMetadata.RemoveProperties(NULL, uuid); - /* have to do the notification ourselves, since the client argument - to fMetadata->RemoveProperties() was NULL - */ - PropertyChangeNotify(uuid, NULL, PropertyDeleted); + if (fMetadata.RemoveProperties(NULL, uuid) > 0) { + /* have to do the notification ourselves, since the client argument + to fMetadata->RemoveProperties() was NULL + */ + PropertyChangeNotify(uuid, NULL, PropertyDeleted); + } // Notify running clients NotifyRemoveClient(client->GetClientControl()->fName, refnum); @@ -912,8 +913,12 @@ int JackEngine::PortUnRegister(int refnum, jack_port_id_t port_index) const jack_uuid_t uuid = jack_port_uuid_generate(port_index); if (!jack_uuid_empty(uuid)) { - fMetadata.RemoveProperties(NULL, uuid); - PropertyChangeNotify(uuid, NULL, PropertyDeleted); + if (fMetadata.RemoveProperties(NULL, uuid) > 0) { + /* have to do the notification ourselves, since the client argument + to fMetadata->RemoveProperties() was NULL + */ + PropertyChangeNotify(uuid, NULL, PropertyDeleted); + } } if (client->GetClientControl()->fActive) { diff --git a/common/jack/metadata.h b/common/jack/metadata.h index 80c7e99a..9e026161 100644 --- a/common/jack/metadata.h +++ b/common/jack/metadata.h @@ -194,6 +194,18 @@ typedef enum { PropertyDeleted } jack_property_change_t; +/** + * Prototype for the client supplied function that is called by the + * engine anytime a property or properties have been modified. + * + * Note that when the key is empty, it means all properties have been + * modified. This is often used to indicate that the removal of all keys. + * + * @param subject The subject the change relates to, this can be either a client or port + * @param key The key of the modified property (URI string) + * @param change Wherever the key has been created, changed or deleted + * @param arg pointer to a client supplied structure + */ typedef void (*JackPropertyChangeCallback)(jack_uuid_t subject, const char* key, jack_property_change_t change,