summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtsushi Eno <atsushieno@gmail.com>2015-09-14 23:30:57 +0800
committerAtsushi Eno <atsushieno@gmail.com>2015-09-14 23:30:57 +0800
commit78799dad96e7741705d5aff82d68f58a9417b8ba (patch)
tree94855ab75dfcd2fb9a84d5ff112fc10d25aa48a8
parent9db036c4496d28d847f5219cf5d05eda65a03f2c (diff)
return duplicated string for port name, to avoid unwanted freeing by bindings.
-rw-r--r--rtmidi_c.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/rtmidi_c.cpp b/rtmidi_c.cpp
index 8c2e676..b259e62 100644
--- a/rtmidi_c.cpp
+++ b/rtmidi_c.cpp
@@ -67,7 +67,7 @@ unsigned int rtmidi_get_port_count (RtMidiPtr device)
const char* rtmidi_get_port_name (RtMidiPtr device, unsigned int portNumber)
{
std::string name = ((RtMidi*) device)->getPortName (portNumber);
- return name.c_str ();
+ return strdup (name.c_str ());
}
/* RtMidiIn API */