diff options
| author | Atsushi Eno <atsushieno@gmail.com> | 2015-09-14 23:30:57 +0800 |
|---|---|---|
| committer | Atsushi Eno <atsushieno@gmail.com> | 2015-09-14 23:30:57 +0800 |
| commit | 78799dad96e7741705d5aff82d68f58a9417b8ba (patch) | |
| tree | 94855ab75dfcd2fb9a84d5ff112fc10d25aa48a8 | |
| parent | 9db036c4496d28d847f5219cf5d05eda65a03f2c (diff) | |
return duplicated string for port name, to avoid unwanted freeing by bindings.
| -rw-r--r-- | rtmidi_c.cpp | 2 |
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 */ |
