You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rd...@apache.org on 2010/02/18 20:32:00 UTC

svn commit: r911536 - /subversion/trunk/subversion/bindings/swig/include/svn_containers.swg

Author: rdonch
Date: Thu Feb 18 19:31:59 2010
New Revision: 911536

URL: http://svn.apache.org/viewvc?rev=911536&view=rev
Log:
Finish the refactoring started in r901007. The new version no longer
leaks svn_auth_provider_object_t references during the call to svn_auth_open;
r911236 ensures backwards-compatible behavior.

* subversion/bindings/swig/include/svn_containers.swg: Replace the body of the
   Python apr_array_header_t *providers input typemap with a call to
   svn_swig_py_seq_to_array.


Modified:
    subversion/trunk/subversion/bindings/swig/include/svn_containers.swg

Modified: subversion/trunk/subversion/bindings/swig/include/svn_containers.swg
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/include/svn_containers.swg?rev=911536&r1=911535&r2=911536&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/include/svn_containers.swg (original)
+++ subversion/trunk/subversion/bindings/swig/include/svn_containers.swg Thu Feb 18 19:31:59 2010
@@ -576,27 +576,13 @@
 
 #ifdef SWIGPYTHON
 %typemap(in) apr_array_header_t *providers {
-    svn_auth_provider_object_t *provider;
-    int targlen;
-    if (!PySequence_Check($input)) {
-        PyErr_SetString(PyExc_TypeError, "not a sequence");
-        SWIG_fail;
-    }
-    
-    targlen = PySequence_Length($input);
-    if (targlen < 0)
-        return NULL;
-
-    $1 = apr_array_make(_global_pool, targlen, sizeof(provider));
-    ($1)->nelts = targlen;
-    while (targlen--) {
-        provider = svn_swig_MustGetPtr(PySequence_GetItem($input, targlen),
-          $descriptor(svn_auth_provider_object_t *), $svn_argnum);
-        if (PyErr_Occurred()) {
-          SWIG_fail;
-        }
-        APR_ARRAY_IDX($1, targlen, svn_auth_provider_object_t *) = provider;
-    }
+    $1 = (apr_array_header_t *) svn_swig_py_seq_to_array($input,
+      sizeof(const svn_auth_provider_object_t *),
+      svn_swig_py_unwrap_struct_ptr,
+      $descriptor(svn_auth_provider_object_t *),
+      _global_pool);
+    if (PyErr_Occurred())
+      SWIG_fail;
 }
 #endif