summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-10-30 17:38:24 +0100
committerRobin Gareus <robin@gareus.org>2016-10-30 17:39:55 +0100
commitdb2d238cecdbb0b58f33c5032191a27ac70669dc (patch)
treefbc21af52f94c093e089459c7a8eb64203d3a9ee /libs/ardour
parent9773cfa92645f8caf8aa524a5e7f45bb4d4d1b24 (diff)
Update prototype API (3f739738) for windows/dll compat
memory allocated by a .dll must be free()d by the given dll.
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/ardour/lv2_extensions.h18
-rw-r--r--libs/ardour/lv2_plugin.cc4
2 files changed, 16 insertions, 6 deletions
diff --git a/libs/ardour/ardour/lv2_extensions.h b/libs/ardour/ardour/lv2_extensions.h
index f38ac8122a..ebdf905fb3 100644
--- a/libs/ardour/ardour/lv2_extensions.h
+++ b/libs/ardour/ardour/lv2_extensions.h
@@ -194,16 +194,26 @@ typedef struct {
} LV2_Midnam;
typedef struct {
- /** query midnam document. The plugin
- * is expected to return an allocated
- * null-terminated XML text, which is
- * safe for the host to pass to free().
+ /** Query midnam document. The plugin
+ * is expected to return a null-terminated XML
+ * text which is a valid midnam desciption
+ * (or NULL in case of error).
*
* The midnam <Model> must be unique and
* specific for the given plugin-instance.
*/
char* (*midnam)(LV2_Handle instance);
+
+ /** The unique model id used ith the midnam,
+ * (or NULL).
+ */
char* (*model)(LV2_Handle instance);
+
+ /** free allocated strings. The host
+ * calls this for every value returned by
+ * \ref midnam and \ref model.
+ */
+ void (*free)(char*);
} LV2_Midnam_Interface;
/**
diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc
index 0892d86c33..94760dc336 100644
--- a/libs/ardour/lv2_plugin.cc
+++ b/libs/ardour/lv2_plugin.cc
@@ -985,7 +985,7 @@ LV2Plugin::read_midnam () {
MIDI::Name::MidiPatchManager::instance().remove_custom_midnam (ss.str());
rv = MIDI::Name::MidiPatchManager::instance().add_custom_midnam (ss.str(), midnam);
}
- free (midnam);
+ _midname_interface->free (midnam);
return rv;
}
@@ -999,7 +999,7 @@ LV2Plugin::midnam_model () {
if (model) {
rv = model;
}
- free (model);
+ _midname_interface->free (model);
return rv;
}
#endif