mama_status qpidBridgeMamaPublisher_destroy (publisherBridge publisher) { qpidPublisherBridge* impl = (qpidPublisherBridge*) publisher; /* Take a copy of the callbacks - we'll need those */ mamaPublisherCallbacks callbacks; mamaPublisher parent = NULL; void* closure = NULL; if (NULL == impl) { return MAMA_STATUS_NULL_ARG; } /* Take a copy of the callbacks - we'll need those */ callbacks = impl->mCallbacks; parent = impl->mParent; closure = impl->mCallbackClosure; if (NULL != impl->mQpidRawMsg) { pn_message_free (impl->mQpidRawMsg); } if (NULL != impl->mSubject) { free ((void*) impl->mSubject); } if (NULL != impl->mUri) { free ((void*) impl->mUri); } if (NULL != impl->mRoot) { free ((void*) impl->mRoot); } if (NULL != impl->mSource) { free ((void*) impl->mSource); } if (NULL != impl->mTopic) { free ((void*) impl->mTopic); } if (NULL != impl->mMamaBridgeMsg) { qpidBridgeMamaMsg_destroy (impl->mMamaBridgeMsg, 0); } if (NULL != callbacks.onDestroy) { (*callbacks.onDestroy)(parent, closure); } free (impl); return MAMA_STATUS_OK; }
mama_status qpidBridgeMamaPublisher_destroy (publisherBridge publisher) { qpidPublisherBridge* impl = (qpidPublisherBridge*) publisher; if (NULL == impl) { return MAMA_STATUS_NULL_ARG; } if (NULL != impl->mQpidRawMsg) { pn_message_free (impl->mQpidRawMsg); } if (NULL != impl->mSubject) { free ((void*) impl->mSubject); } if (NULL != impl->mUri) { free ((void*) impl->mUri); } if (NULL != impl->mRoot) { free ((void*) impl->mRoot); } if (NULL != impl->mSource) { free ((void*) impl->mSource); } if (NULL != impl->mTopic) { free ((void*) impl->mTopic); } if (NULL != impl->mMamaBridgeMsg) { qpidBridgeMamaMsg_destroy (impl->mMamaBridgeMsg, 0); } free (impl); return MAMA_STATUS_OK; }