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

Re: svn commit: rev 3202 - trunk/subversion/bindings/swig

From: <cmpilato_at_collab.net>
Date: 2002-09-21 16:46:19 CEST

Greg Stein <gstein@lyra.org> writes:

> > - /* ### for now, we're leaving CHANGED_PATHS outta this. */
> > + if (changed_paths)
> > + chpaths = svn_swig_py_convert_hash (changed_paths, tinfo);
> > + else
> > + chpaths = Py_None;
> >
> > /* ### python doesn't have 'const' on the method name and format */
> > if ((result = PyObject_CallFunction(receiver,
> > - (char *)"lsssO&",
> > - rev, author, date, msg,
> > + (char *)"OlsssO&",
> > + chpaths, rev, author, date, msg,
> > make_ob_pool, pool)) == NULL)
> > {
> > return convert_python_error(pool);
>
> You need to refcount chpaths properly. svn_swig_py_convert_hash() will
> pass a ref back to you, which means you must DECREF it when you're done. To
> simplify the decref logic, you can just incref Py_None before putting it
> into chpaths. After the function call, then you need to decref chpaths (and
> ensure that you do the decref in the error case, too)

Doh! You're absolutely right. Will fix this when next I'm in a State
of Hacking.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Sep 21 16:47:29 2002

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