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 01:34:29 UTC

svn commit: r911236 - /subversion/trunk/subversion/bindings/swig/core.i

Author: rdonch
Date: Thu Feb 18 00:34:29 2010
New Revision: 911236

URL: http://svn.apache.org/viewvc?rev=911236&view=rev
Log:
SWIG/Python: make the auth baton reference its providers, so that it remains
valid even if the user didn't keep any references himself.
Note: currently, it remains valid as well, but that's because of an object
leak in a typemap, which will be fixed shortly.

* subversion/bindings/swig/core.i: Insert a helper that stores a reference
   to providers in the auth baton wrapper after svn_auth_open.


Modified:
    subversion/trunk/subversion/bindings/swig/core.i

Modified: subversion/trunk/subversion/bindings/swig/core.i
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/core.i?rev=911236&r1=911235&r2=911236&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/core.i (original)
+++ subversion/trunk/subversion/bindings/swig/core.i Thu Feb 18 00:34:29 2010
@@ -745,6 +745,16 @@
 %ignore svn_opt_parse_all_args;
 #endif
 
+#ifdef SWIGPYTHON
+# The auth baton depends on the providers, so we preserve a
+# reference to them inside the wrapper. This way, if all external
+# references to the providers are gone, they will still be alive,
+# keeping the baton valid.
+%feature("pythonappend") svn_auth_open %{
+   val.__dict__["_deps"] = list(args[0])
+%}
+#endif
+
 /* ----------------------------------------------------------------------- */
 
 %include svn_error_codes_h.swg