Sun Java System Message Queue 4.3 Developer's Guide for C Clients


The MQFreeConnection function deallocates memory assigned to the specified connection and to all resources associated with that connection.

MQFreeConnection(MQConnectionHandle connectionHandle);

Return Value

MQStatus. See the MQStatusIsError() function for more information.



A handle to the connection you want to free.

You must call this function after you have closed the connection with the MQCloseConnection() function and after all of the application threads associated with this connection and its dependent sessions, producers, and consumers have returned.

You must not call this function while an application thread is active in a library function associated with this connection or one of its dependent sessions, producers, consumers, and destinations.

Calling this function does not release resources held by a message or a destination associated with this connection. You must free memory allocated for a message or a destination by explicitly calling the MQFreeMessage or the MQFreeDestination function.

Common Errors