void bitclient_destroyTransaction(bitclientTransaction_t* tx) { for(uint32 i=0; i<tx->tx_in->objectCount; i++) free(tx->tx_in->objects[i]); for(uint32 i=0; i<tx->tx_out->objectCount; i++) free(tx->tx_out->objects[i]); simpleList_free(tx->tx_in); simpleList_free(tx->tx_out); free(tx); }
/* * Helper method in case parsing of an array fails and the already parsed data needs to be freed again */ void jsonObject_destroyArray(jsonObjectArray_t* jsonObjectArray) { for(uint32 i=0; i<jsonObjectArray->list_values->objectCount; i++) { jsonObject_t* objValue = (jsonObject_t*)simpleList_get(jsonObjectArray->list_values, i); jsonObject_freeObject(objValue); } simpleList_free(jsonObjectArray->list_values); free(jsonObjectArray); }
/* * Disconnects and frees the xptClient instance */ void xptClient_free(xptClient_t* xptClient) { xptPacketbuffer_free(xptClient->sendBuffer); xptPacketbuffer_free(xptClient->recvBuffer); if( xptClient->clientSocket != SOCKET_ERROR ) { closesocket(xptClient->clientSocket); } simpleList_free(xptClient->list_shareSubmitQueue); free(xptClient); }