improved (as in "correct") deadlock fix for PresentationInfo::Change
[ardour.git] / libs / backends / jack / jack_portengine.cc
index 934f8b5d9e0cc583eb8686750c757f46610a2abe..a73f4608aa58b7a12dd97baf4f3ab132d849646f 100644 (file)
@@ -135,12 +135,17 @@ JACKAudioBackend::get_port_property (PortHandle port, const std::string& key, st
        jack_uuid_t uuid = jack_port_uuid((jack_port_t*) port);
        rv = jack_get_property(uuid, key.c_str(), &cvalue, &ctype);
 
-       if (0 == rv) {
+       if (0 == rv && cvalue) {
                value = cvalue;
-               type = ctype;
-               jack_free(cvalue);
-               jack_free(ctype);
+               if (ctype) {
+                       type = ctype;
+               }
+       } else {
+               rv = -1;
        }
+
+       jack_free(cvalue);
+       jack_free(ctype);
        return rv;
 #else
        return -1;