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

Re: svn commit: r1676769 - /subversion/trunk/subversion/bindings/javahl/native/CreateJ.cpp

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Wed, 29 Apr 2015 18:44:56 +0100

brane_at_apache.org writes:

> Author: brane
> Date: Wed Apr 29 15:30:54 2015
> New Revision: 1676769
>
> URL: http://svn.apache.org/r1676769
> Log:
> Fix another silly memory leak in JavaHL.
> This time, we forgot to close off a JNI frame.

> - m_env->CallObjectMethod(m_map, m_put_mid, jpropName, jpropVal);
> + jobject ret = m_env->CallObjectMethod(m_map, m_put_mid,
> + jpropName, jpropVal);
> if (JNIUtil::isJavaExceptionThrown())
> return;
>
> - m_env->DeleteLocalRef(jpropName);
> + m_env->DeleteLocalRef(ret);

Should we do the same to the other places we use CallObjectMethod
without calling DeleteLocalRef? As I understand it the local ref
"leaks" are temporary and only really matter if we create them in some
sort of loop. So perhaps

  CreateJ::LockMap
  RemoteSession::getMergeinfo (and the fill_dirents and
                               location_hash_to_map functions)

-- 
Philip Martin | Subversion Committer
WANdisco // *Non-Stop Data*
Received on 2015-04-29 19:46:17 CEST

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.