From 79effba1aa3c324a2d800d4e8d3badb0a09808c1 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 5 Sep 1999 23:30:54 +0000 Subject: [PATCH] (__db_rdetach): Unmap the region if necessary. --- db2/common/db_region.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/db2/common/db_region.c b/db2/common/db_region.c index 284af6176a7..4542fcf5d2e 100644 --- a/db2/common/db_region.c +++ b/db2/common/db_region.c @@ -507,8 +507,18 @@ __db_rdetach(infop) * If the region was removed when it was created, no further action * is required. */ - if (F_ISSET(infop, REGION_REMOVED)) + if (F_ISSET(infop, REGION_REMOVED)) { + if (F_ISSET(infop, REGION_PRIVATE) + && !F_ISSET(infop, REGION_MALLOC)) + /* + * If it is private and not malloced, the + * region is still mapped in. We need to + * discard our mapping of the region. + */ + ret = __db_unmapregion(infop); goto done; + } + /* * If the region was created in memory returned by malloc, the only * action required is freeing the memory. -- 2.47.2