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

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

From: Marc Haesen <Marc.Haesen_at_telindus.be>
Date: 2005-09-26 16:18:20 CEST

Hi,

The current python bindings on trunk are crashing in windows. The reason is that in some cases the variable _global_pool is NULL, depending from which python module (dll) the libsvn_swig_py functions are called.
This can easily be solved by compiling the libsvn_swig_py module to a dll instead of a static library. In this case all functions of the libsvn_swig_py module need to be exported to.

I have made these changes locally, and they seem to solve the crash.

Regards,
Marc

-----Original Message-----
From: André Malo [mailto:nd@perlig.de]
Sent: Friday, September 23, 2005 00:09
To: dev@subversion.tigris.org; David James
Subject: Re: svn commit: r16211 - trunk/subversion/bindings/swig/python/svn

* David James wrote:

> > 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).
>
> Is this necessary? If you use None as your pool, the SWIG bindings
> should automatically create an anonymous pool for us, which should get
> destroyed automatically at the appropriate time (assuming everything
> works as promised).

The pools are garbage collected - oh well (found the place now...)

But I've got another thing then. Wouldn't it make more sense to make the
pool arguments dummies at all (for backwards compat), i.e. /always/ throw
away any pool from outside and use an anonymous one? The result would be
very pythonic!

For example, this code from svn.fs still uses the supplied pool. I'm
wondering why ;-) Perhaps just an oversight?

  def _dump_contents(self, file, root, path, pool=None):
    fp = __builtin__.open(file, 'w+') # avoid namespace clash with
                                      # trimmed-down svn_fs_open()
    if path is not None:
      stream = file_contents(root, path, pool)
      try:
        while 1:
          chunk = _core.svn_stream_read(stream, _core.SVN_STREAM_CHUNK_SIZE)
          if not chunk:
            break
          fp.write(chunk)
      finally:
        _core.svn_stream_close(stream)
    fp.close()

nd

-- 
"Umfassendes Werk (auch fuer Umsteiger vom Apache 1.3)"
                                          -- aus einer Rezension
<http://pub.perlig.de/books.html#apache2>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
32nd International Telindus Symposium
Thursday, 27 October 2005, Brussels Expo, Belgium
Innovision: see how ICT empowers your vision and enables innovation.
The one-day ICT event for business professionals!
Programme and free registration > http://www.telindussymposium.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Sep 26 18:49:36 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.