free lv2 ports slice
This commit is contained in:
parent
7097334201
commit
5e8093b26f
2 changed files with 3 additions and 0 deletions
|
@ -307,6 +307,7 @@ pub const Image = struct {
|
|||
defer ctx.deinit();
|
||||
|
||||
var ports = try lv2.setupPorts(&ctx);
|
||||
defer ctx.allocator.free(ports);
|
||||
|
||||
if (ctx.n_audio_in > 2) {
|
||||
std.debug.warn("plugin <{}> has more than two inputs.\n", .{plugin_uri});
|
||||
|
|
|
@ -59,6 +59,8 @@ pub const Port = struct {
|
|||
/// Setup ports for a given plugin. Gives an array to pointers of Port structs.
|
||||
/// This setup is required so we link the plugin to the ports later on, and
|
||||
/// also link our buffers, and control values.
|
||||
///
|
||||
/// Caller owns returned memory.
|
||||
pub fn setupPorts(ctx: *plugin.Context) ![]Port {
|
||||
var world = ctx.world;
|
||||
const n_ports: u32 = c.lilv_plugin_get_num_ports(ctx.plugin);
|
||||
|
|
Loading…
Reference in a new issue