diff --git a/ChangeLog b/ChangeLog index fc44fc34..5a071e89 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,6 +25,10 @@ Paul Davis Jackdmp changes log --------------------------- +2009-05-11 Stephane Letz + + * New jack_free function added in jack.h. + 2009-05-07 Stephane Letz * Cleanup "loopback" stuff in server. diff --git a/common/JackAPI.cpp b/common/JackAPI.cpp index c8a85f1b..3312c9f1 100644 --- a/common/JackAPI.cpp +++ b/common/JackAPI.cpp @@ -241,6 +241,7 @@ extern "C" EXPORT jack_status_t jack_internal_client_unload (jack_client_t *client, jack_intclient_t intclient); + EXPORT void jack_free(void* ptr); #ifdef __cplusplus } @@ -1930,3 +1931,8 @@ jack_get_version_string() { return VERSION; } + +EXPORT void jack_free(void* ptr) +{ + free(ptr); +} diff --git a/common/jack/jack.h b/common/jack/jack.h index a0b0e397..f9d8d4e0 100644 --- a/common/jack/jack.h +++ b/common/jack/jack.h @@ -1070,6 +1070,16 @@ void jack_set_info_function (void (*func)(const char *)); /*@}*/ +/** + * The free function to be used on memory returned by jack_port_get_connections, + * jack_port_get_all_connections and jack_get_ports functions. + * This is MANDATORY on Windows when otherwise all nasty runtime version related crashes can occur. + * Developers are strongly encouraged to use this function instead of the standard "free" function in new code. + * + */ +void jack_free(void* ptr); + + #ifdef __cplusplus } #endif