Kaydet (Commit) 05a24d7f authored tarafından Gregory P. Smith's avatar Gregory P. Smith

* closes SF bug/patch 967763

  - fixes various memory leaks found by valgrind and a follup closer
    code inspection of the bsddb module.  (merges r1.32 of _bsddb.c
    and an associated test case)
  - also merges the one line r1.37 _bsddb.c fix that fixes a leak on
    the rare DBEnv creation failed error path.
üst 923fae44
...@@ -133,6 +133,15 @@ class SimpleRecnoTestCase(unittest.TestCase): ...@@ -133,6 +133,15 @@ class SimpleRecnoTestCase(unittest.TestCase):
if verbose: if verbose:
print rec print rec
# test that non-existant key lookups work (and that
# DBC_set_range doesn't have a memleak under valgrind)
old_grn = d.set_get_returns_none(2)
rec = c.set_range(999999)
assert rec == None
if verbose:
print rec
d.set_get_returns_none(old_grn)
c.close() c.close()
d.close() d.close()
...@@ -177,6 +186,8 @@ class SimpleRecnoTestCase(unittest.TestCase): ...@@ -177,6 +186,8 @@ class SimpleRecnoTestCase(unittest.TestCase):
""" """
source = os.path.join(os.path.dirname(sys.argv[0]), source = os.path.join(os.path.dirname(sys.argv[0]),
'db_home/test_recno.txt') 'db_home/test_recno.txt')
if not os.path.isdir('db_home'):
os.mkdir('db_home')
f = open(source, 'w') # create the file f = open(source, 'w') # create the file
f.close() f.close()
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment