mirror of https://github.com/citusdata/citus.git
Call DestReceiver rDestroy before it goes out of scope
CitusCopyDestReceiverDestroy: call hash_destroy on shardStateHash & connectionStateHashpull/3168/head
parent
adc6ca6100
commit
48552bfffe
|
@ -1343,6 +1343,7 @@ CopyLocalDataIntoShards(Oid distributedRelationId)
|
|||
|
||||
/* finish writing into the shards */
|
||||
copyDest->rShutdown(copyDest);
|
||||
copyDest->rDestroy(copyDest);
|
||||
|
||||
/* free memory and close the relation */
|
||||
ExecDropSingleTupleTableSlot(slot);
|
||||
|
|
|
@ -598,6 +598,7 @@ CopyToExistingShards(CopyStmt *copyStatement, char *completionTag)
|
|||
|
||||
/* finish the COPY commands */
|
||||
dest->rShutdown(dest);
|
||||
dest->rDestroy(dest);
|
||||
|
||||
ExecDropSingleTupleTableSlot(tupleTableSlot);
|
||||
FreeExecutorState(executorState);
|
||||
|
@ -2692,6 +2693,9 @@ ShutdownCopyConnectionState(CopyConnectionState *connectionState,
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* CitusCopyDestReceiverDestroy frees the DestReceiver
|
||||
*/
|
||||
static void
|
||||
CitusCopyDestReceiverDestroy(DestReceiver *destReceiver)
|
||||
{
|
||||
|
@ -2712,6 +2716,16 @@ CitusCopyDestReceiverDestroy(DestReceiver *destReceiver)
|
|||
pfree(copyDest->columnCoercionPaths);
|
||||
}
|
||||
|
||||
if (copyDest->shardStateHash)
|
||||
{
|
||||
hash_destroy(copyDest->shardStateHash);
|
||||
}
|
||||
|
||||
if (copyDest->connectionStateHash)
|
||||
{
|
||||
hash_destroy(copyDest->connectionStateHash);
|
||||
}
|
||||
|
||||
pfree(copyDest);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue