subversion-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philip Martin <phi...@codematters.co.uk>
Subject Re: Warnings from the bindings
Date Fri, 06 Apr 2018 19:21:33 GMT
Branko Čibej <brane@apache.org> writes:

> And I don't see these, either. I checked the code and we explicitly use
> a JNI local frame in the core loop of unparseExternals. Try as I might,
> I can't see where all those local references could be coming from.

ImmutableList::for_each appears to be the problem.  The following ugly
hack is not correct but does resolve the warning:

Index: subversion/bindings/javahl/native/jniwrapper/jni_list.hpp
===================================================================
--- subversion/bindings/javahl/native/jniwrapper/jni_list.hpp	(revision 1828477)
+++ subversion/bindings/javahl/native/jniwrapper/jni_list.hpp	(working copy)
@@ -172,8 +172,18 @@ class ImmutableList : public BaseImmutableList
   F for_each(F function) const
     {
       Iterator iter(get_iterator());
-      while (iter.has_next())
+      while (true)
+      {
+        m_env.PushLocalFrame(10);
+	bool has_next = iter.has_next();
+	if (!has_next)
+	{
+          m_env.PopLocalFrame();
+	  break;
+	}
         function(T(m_env, NativeT(iter.next())));
+        m_env.PopLocalFrame();
+      }
       return function;
     }
 };

-- 
Philip

Mime
View raw message