Browse Source

Use of jack_free instead of free, cleanup.

tags/1.9.9.5
Stephane Letz 12 years ago
parent
commit
a750131fba
8 changed files with 12 additions and 18 deletions
  1. +0
    -3
      common/JackInternalClient.cpp
  2. +1
    -1
      common/JackLibAPI.cpp
  3. +2
    -2
      common/JackRequestDecoder.cpp
  4. +1
    -1
      common/jack/intclient.h
  5. +4
    -4
      common/jack/jack.h
  6. +2
    -2
      example-clients/control.c
  7. +2
    -2
      example-clients/tw.c
  8. +0
    -3
      windows/JackWinNamedPipeServerChannel.h

+ 0
- 3
common/JackInternalClient.cpp View File

@@ -27,10 +27,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#include "JackServer.h" #include "JackServer.h"
#include "JackEngineControl.h" #include "JackEngineControl.h"
#include "JackClientControl.h" #include "JackClientControl.h"

#include "JackInternalClientChannel.h" #include "JackInternalClientChannel.h"
#include "JackGenericClientChannel.h"

#include "JackTools.h" #include "JackTools.h"
#include <assert.h> #include <assert.h>




+ 1
- 1
common/JackLibAPI.cpp View File

@@ -166,7 +166,7 @@ static jack_client_t* jack_client_open_aux(const char* client_name, jack_options


LIB_EXPORT jack_client_t* jack_client_open(const char* ext_client_name, jack_options_t options, jack_status_t* status, ...) LIB_EXPORT jack_client_t* jack_client_open(const char* ext_client_name, jack_options_t options, jack_status_t* status, ...)
{ {
JackGlobals::CheckContext("jack_client_open");
JackGlobals::CheckContext("jack_client_open");


try { try {
assert(JackGlobals::fOpenMutex); assert(JackGlobals::fOpenMutex);


+ 2
- 2
common/JackRequestDecoder.cpp View File

@@ -46,7 +46,7 @@ int JackRequestDecoder::HandleRequest(detail::JackChannelTransactionInterface* s
{ {
JackRequest::RequestType type = (JackRequest::RequestType)type_aux; JackRequest::RequestType type = (JackRequest::RequestType)type_aux;


// Read data
// Read data
switch (type) { switch (type) {


case JackRequest::kClientCheck: { case JackRequest::kClientCheck: {
@@ -82,7 +82,7 @@ int JackRequestDecoder::HandleRequest(detail::JackChannelTransactionInterface* s
CheckRead(req, socket); CheckRead(req, socket);
res.fResult = fServer->GetEngine()->ClientExternalClose(req.fRefNum); res.fResult = fServer->GetEngine()->ClientExternalClose(req.fRefNum);
CheckWriteRefNum("JackRequest::ClientClose", socket); CheckWriteRefNum("JackRequest::ClientClose", socket);
fHandler->ClientRemove(socket, req.fRefNum);
fHandler->ClientRemove(socket, req.fRefNum);
// Will cause the wrapping thread to stop // Will cause the wrapping thread to stop
return -1; return -1;
} }


+ 1
- 1
common/jack/intclient.h View File

@@ -40,7 +40,7 @@ extern "C"
* *
* @return NULL if unsuccessful, otherwise pointer to the internal * @return NULL if unsuccessful, otherwise pointer to the internal
* client name obtained from the heap via malloc(). The caller should * client name obtained from the heap via malloc(). The caller should
* free() this storage when no longer needed.
* jack_free() this storage when no longer needed.
*/ */
char *jack_get_internal_client_name (jack_client_t *client, char *jack_get_internal_client_name (jack_client_t *client,
jack_intclient_t intclient); jack_intclient_t intclient);


+ 4
- 4
common/jack/jack.h View File

@@ -798,7 +798,7 @@ int jack_port_connected_to (const jack_port_t *port,
* @return a null-terminated array of full port names to which the @a * @return a null-terminated array of full port names to which the @a
* port is connected. If none, returns NULL. * port is connected. If none, returns NULL.
* *
* The caller is responsible for calling jack_free(3) on any non-NULL
* The caller is responsible for calling jack_free() on any non-NULL
* returned value. * returned value.
* *
* @param port locally owned jack_port_t pointer. * @param port locally owned jack_port_t pointer.
@@ -811,7 +811,7 @@ const char ** jack_port_get_connections (const jack_port_t *port) JACK_OPTIONAL_
* @return a null-terminated array of full port names to which the @a * @return a null-terminated array of full port names to which the @a
* port is connected. If none, returns NULL. * port is connected. If none, returns NULL.
* *
* The caller is responsible for calling jack_free(3) on any non-NULL
* The caller is responsible for calling jack_free() on any non-NULL
* returned value. * returned value.
* *
* This differs from jack_port_get_connections() in two important * This differs from jack_port_get_connections() in two important
@@ -1220,7 +1220,7 @@ int jack_recompute_total_latency (jack_client_t*, jack_port_t* port) JACK_OPTION
* If zero, no selection based on flags will be carried out. * If zero, no selection based on flags will be carried out.
* *
* @return a NULL-terminated array of ports that match the specified * @return a NULL-terminated array of ports that match the specified
* arguments. The caller is responsible for calling jack_free(3) any
* arguments. The caller is responsible for calling jack_free() any
* non-NULL returned value. * non-NULL returned value.
* *
* @see jack_port_name_size(), jack_port_type_size() * @see jack_port_name_size(), jack_port_type_size()
@@ -1400,7 +1400,7 @@ void jack_set_info_function (void (*func)(const char *)) JACK_OPTIONAL_WEAK_EXPO


/** /**
* The free function to be used on memory returned by jack_port_get_connections, * The free function to be used on memory returned by jack_port_get_connections,
* jack_port_get_all_connections and jack_get_ports functions.
* jack_port_get_all_connections, jack_get_ports and jack_get_internal_client_name functions.
* This is MANDATORY on Windows when otherwise all nasty runtime version related crashes can occur. * 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. * Developers are strongly encouraged to use this function instead of the standard "free" function in new code.
* *


+ 2
- 2
example-clients/control.c View File

@@ -27,7 +27,7 @@ static int Jack_Graph_Order_Callback(void *arg)
for (i = 0; ports[i]; ++i) { for (i = 0; ports[i]; ++i) {
printf("name: %s\n", ports[i]); printf("name: %s\n", ports[i]);
} }
free(ports);
jack_free(ports);
} }


ports = jack_get_ports(client, NULL, NULL, JackPortIsPhysical|JackPortIsInput); ports = jack_get_ports(client, NULL, NULL, JackPortIsPhysical|JackPortIsInput);
@@ -35,7 +35,7 @@ static int Jack_Graph_Order_Callback(void *arg)
for (i = 0; ports[i]; ++i) { for (i = 0; ports[i]; ++i) {
printf("name: %s\n", ports[i]); printf("name: %s\n", ports[i]);
} }
free(ports);
jack_free(ports);
} }


return 0; return 0;


+ 2
- 2
example-clients/tw.c View File

@@ -231,7 +231,7 @@ main (int argc, char *argv[])
fprintf (stderr, "cannot connect input ports\n"); fprintf (stderr, "cannot connect input ports\n");
} }


free (ports);
jack_free (ports);


ports = jack_get_ports (client, NULL, NULL, ports = jack_get_ports (client, NULL, NULL,
JackPortIsPhysical|JackPortIsInput); JackPortIsPhysical|JackPortIsInput);
@@ -244,7 +244,7 @@ main (int argc, char *argv[])
fprintf (stderr, "cannot connect output ports\n"); fprintf (stderr, "cannot connect output ports\n");
} }


free (ports);
jack_free (ports);


/* install a signal handler to properly quits jack client */ /* install a signal handler to properly quits jack client */
signal(SIGQUIT, signal_handler); signal(SIGQUIT, signal_handler);


+ 0
- 3
windows/JackWinNamedPipeServerChannel.h View File

@@ -17,16 +17,13 @@


*/ */



#ifndef __JackWinNamedPipeServerChannel__ #ifndef __JackWinNamedPipeServerChannel__
#define __JackWinNamedPipeServerChannel__ #define __JackWinNamedPipeServerChannel__


#include "JackWinNamedPipe.h" #include "JackWinNamedPipe.h"
#include "JackPlatformPlug.h" #include "JackPlatformPlug.h"
#include "JackConstants.h" #include "JackConstants.h"

#include "JackRequestDecoder.h" #include "JackRequestDecoder.h"

#include <list> #include <list>


namespace Jack namespace Jack


Loading…
Cancel
Save