You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-07-17 01:12:23 +02:00
Various MemContext callback improvements.
Rename memContextCallback() to memContextCallbackSet() to be more consistent with other parts of the code. Free all context memory when an exception is thrown from a callback. Previously only the child contexts would be freed and this resulted in some allocations being lost. In practice this is probably not a big deal since the process will likely terminate shortly, but there may well be cases where that is not true.
This commit is contained in:
@ -110,7 +110,7 @@ protocolClientNew(const String *name, const String *service, IoRead *read, IoWri
|
||||
protocolClientNoOp(this);
|
||||
|
||||
// Set a callback to shutdown the protocol
|
||||
memContextCallback(this->memContext, (MemContextCallback)protocolClientFree, this);
|
||||
memContextCallbackSet(this->memContext, (MemContextCallback)protocolClientFree, this);
|
||||
}
|
||||
MEM_CONTEXT_NEW_END();
|
||||
|
||||
|
Reference in New Issue
Block a user