[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r16211 - trunk/subversion/bindings/swig/python/svn

From: André Malo <nd_at_perlig.de>
Date: 2005-09-22 22:49:11 CEST

* djames@tigris.org wrote:

> Author: djames
> Date: Thu Sep 22 15:22:00 2005
> New Revision: 16211
>
> Modified:
> trunk/subversion/bindings/swig/python/svn/delta.py
> trunk/subversion/bindings/swig/python/svn/fs.py
> trunk/subversion/bindings/swig/python/svn/repos.py
>
> Log:
> Update high-level Python bindings API to make all pool parameters
> optional, and to consistently use our new automatic pool management API.

Hmm. These changes will create a lot of pools at import time which even may
not be used (if the caller chooses to supply its own pool).
Furthermore, you leak memory now, because the pools are never cleared. (Or
do I miss something magical in the swig stuff?).

The pool creation at import time can be solved by using

def foo(..., pool = None):
   if pool is None:
      pool = Pool()

The leaks probably need to be solved by explicitly calling pool.clear() at
the proper places (using subpools and try: finally: may be a good choice).

nd

-- 
die (eval q-qq:Just Another Perl Hacker
:-)
# André Malo, <http://pub.perlig.de/> #
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Sep 22 22:50:11 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.