summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/GDBM_File/GDBM_File.xs8
-rw-r--r--ext/NDBM_File/NDBM_File.xs8
-rw-r--r--ext/ODBM_File/ODBM_File.xs8
3 files changed, 24 insertions, 0 deletions
diff --git a/ext/GDBM_File/GDBM_File.xs b/ext/GDBM_File/GDBM_File.xs
index d1f99e2d9e..b418b2537b 100644
--- a/ext/GDBM_File/GDBM_File.xs
+++ b/ext/GDBM_File/GDBM_File.xs
@@ -94,6 +94,14 @@ gdbm_DESTROY(db)
GDBM_File db
CODE:
gdbm_close(db);
+ if (db->filter_fetch_key)
+ SvREFCNT_dec(db->filter_fetch_key) ;
+ if (db->filter_store_key)
+ SvREFCNT_dec(db->filter_store_key) ;
+ if (db->filter_fetch_value)
+ SvREFCNT_dec(db->filter_fetch_value) ;
+ if (db->filter_store_value)
+ SvREFCNT_dec(db->filter_store_value) ;
safefree(db);
#define gdbm_FETCH(db,key) gdbm_fetch(db->dbp,key)
diff --git a/ext/NDBM_File/NDBM_File.xs b/ext/NDBM_File/NDBM_File.xs
index aa769ecf9d..84d44cba46 100644
--- a/ext/NDBM_File/NDBM_File.xs
+++ b/ext/NDBM_File/NDBM_File.xs
@@ -80,6 +80,14 @@ ndbm_DESTROY(db)
NDBM_File db
CODE:
dbm_close(db->dbp);
+ if (db->filter_fetch_key)
+ SvREFCNT_dec(db->filter_fetch_key) ;
+ if (db->filter_store_key)
+ SvREFCNT_dec(db->filter_store_key) ;
+ if (db->filter_fetch_value)
+ SvREFCNT_dec(db->filter_fetch_value) ;
+ if (db->filter_store_value)
+ SvREFCNT_dec(db->filter_store_value) ;
safefree(db);
#define ndbm_FETCH(db,key) dbm_fetch(db->dbp,key)
diff --git a/ext/ODBM_File/ODBM_File.xs b/ext/ODBM_File/ODBM_File.xs
index 2510d5e4f3..8faf4a92d6 100644
--- a/ext/ODBM_File/ODBM_File.xs
+++ b/ext/ODBM_File/ODBM_File.xs
@@ -122,6 +122,14 @@ DESTROY(db)
CODE:
dbmrefcnt--;
dbmclose();
+ if (db->filter_fetch_key)
+ SvREFCNT_dec(db->filter_fetch_key) ;
+ if (db->filter_store_key)
+ SvREFCNT_dec(db->filter_store_key) ;
+ if (db->filter_fetch_value)
+ SvREFCNT_dec(db->filter_fetch_value) ;
+ if (db->filter_store_value)
+ SvREFCNT_dec(db->filter_store_value) ;
safefree(db);
datum_value