bitcoin/BRWallet.c
// frees memory allocated for wallet, and calls BRTransactionFree() for all registered transactions
frees memory allocated for wallet, and calls BRTransactionFree() for all registered transactions
frees memory allocated for wallet and calls BRTransactionFree () for all registered transactions
void BRWalletFree(BRWallet *wallet)
{
    assert(wallet != NULL);
    pthread_mutex_lock(&wallet->lock);
    BRSetFree(wallet->allPKH);
    BRSetFree(wallet->usedPKH);
    BRSetFree(wallet->invalidTx);
    BRSetFree(wallet->pendingTx);
    BRSetApply(wallet->allTx, NULL, _setApplyFreeTx);
    BRSetFree(wallet->allTx);
    BRSetFree(wallet->spentOutputs);
    array_free(wallet->internalChain);
    array_free(wallet->externalChain);
    array_free(wallet->balanceHist);
    array_free(wallet->transactions);
    array_free(wallet->utxos);
    pthread_mutex_unlock(&wallet->lock);
    pthread_mutex_destroy(&wallet->lock);
    free(wallet);
}
void BRWalletFree ( BRWallet * wallet ) { assert ( wallet != NULL ) ; pthread_mutex_lock ( & wallet -> lock ) ; BRSetFree ( wallet -> allPKH ) ; BRSetFree ( wallet -> usedPKH ) ; BRSetFree ( wallet -> invalidTx ) ; BRSetFree ( wallet -> pendingTx ) ; BRSetApply ( wallet -> allTx , NULL , _setApplyFreeTx ) ; BRSetFree ( wallet -> allTx ) ; BRSetFree ( wallet -> spentOutputs ) ; array_free ( wallet -> internalChain ) ; array_free ( wallet -> externalChain ) ; array_free ( wallet -> balanceHist ) ; array_free ( wallet -> transactions ) ; array_free ( wallet -> utxos ) ; pthread_mutex_unlock ( & wallet -> lock ) ; pthread_mutex_destroy ( & wallet -> lock ) ; free ( wallet ) ; }
frees memory allocated for wallet, and calls BRTransactionFree() for all registered transactions
frees memory allocated for wallet and calls BRTransactionFree () for all registered transactions