pgbackrest.git / summary / log / commit / refs

commit    b9233f7412e44c8daf41db05bd9699fa088ece5d
Author:   David Steele <david@pgmasters.net>
Date:     Thu Jun 13 16:44:40 2019 +0000

    Create filter group in read/write object's memory context.
    
    The filter group was being created in the parent context so it would go away if the parent context was freed.


src/common/io/read.c | 8 +++++++- src/common/io/write.c | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/common/io/read.c b/src/common/io/read.c index 30d9f1f4c..91ee8b580 100644 --- a/src/common/io/read.c +++ b/src/common/io/read.c @@ -84,7 +84,13 @@ ioReadOpen(IoRead *this) { // If no filter group exists create one to do buffering if (this->filterGroup == NULL) - this->filterGroup = ioFilterGroupNew(); + { + MEM_CONTEXT_BEGIN(this->memContext) + { + this->filterGroup = ioFilterGroupNew(); + } + MEM_CONTEXT_END(); + } ioFilterGroupOpen(this->filterGroup); } diff --git a/src/common/io/write.c b/src/common/io/write.c index 9d3f7ccbd..6a49390b8 100644 --- a/src/common/io/write.c +++ b/src/common/io/write.c @@ -79,7 +79,13 @@ ioWriteOpen(IoWrite *this) // If no filter group exists create one to do buffering if (this->filterGroup == NULL) - this->filterGroup = ioFilterGroupNew(); + { + MEM_CONTEXT_BEGIN(this->memContext) + { + this->filterGroup = ioFilterGroupNew(); + } + MEM_CONTEXT_END(); + } ioFilterGroupOpen(this->filterGroup); [parent: 20be5c9bf39d]