diff options
Diffstat (limited to 'subversion/bindings/swig/python/tests/delta.py')
-rw-r--r-- | subversion/bindings/swig/python/tests/delta.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/subversion/bindings/swig/python/tests/delta.py b/subversion/bindings/swig/python/tests/delta.py index f668c32..b054fcd 100644 --- a/subversion/bindings/swig/python/tests/delta.py +++ b/subversion/bindings/swig/python/tests/delta.py @@ -21,6 +21,7 @@ import unittest, setup_path import os import tempfile +import weakref import svn.delta import svn.core from sys import version_info # For Python version check @@ -117,6 +118,19 @@ class DeltaTestCase(unittest.TestCase): # Check that the ops inherit the window's pool self.assertEqual(window.ops[0]._parent_pool, window._parent_pool) + def testMakeEditorLeak(self): + """Issue 4916, check ref-count leak on svn.delta.make_editor()""" + pool = svn.core.Pool() + editor = svn.delta.Editor() + editor_ref = weakref.ref(editor) + e_ptr, e_baton = svn.delta.make_editor(editor, pool) + del e_ptr, e_baton + self.assertNotEqual(editor_ref(), None) + del pool + self.assertNotEqual(editor_ref(), None) + del editor + self.assertEqual(editor_ref(), None) + def suite(): return unittest.defaultTestLoader.loadTestsFromTestCase(DeltaTestCase) |