You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2013/06/26 06:38:05 UTC
svn commit: r1496729 - in
/subversion/trunk/subversion/bindings/javahl/native: OperationContext.cpp
SVNClient.cpp
Author: brane
Date: Wed Jun 26 04:38:05 2013
New Revision: 1496729
URL: http://svn.apache.org/r1496729
Log:
Do not create too many global references in JavaHL.
[in subversion/bindings/javahl/native]
* OperationContext.cpp (OperationContext::getSelf): Do not create a new
global reference to the Java context object; the C++ context already
maintains one.
* SVNClient.cpp (SVNClient::openRemoteSession): Adjust caller.
Modified:
subversion/trunk/subversion/bindings/javahl/native/OperationContext.cpp
subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp
Modified: subversion/trunk/subversion/bindings/javahl/native/OperationContext.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/OperationContext.cpp?rev=1496729&r1=1496728&r2=1496729&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/OperationContext.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/OperationContext.cpp Wed Jun 26 04:38:05 2013
@@ -215,10 +215,7 @@ OperationContext::getAuthBaton(SVN::Pool
jobject OperationContext::getSelf() const
{
- jobject jctx = JNIUtil::getEnv()->NewGlobalRef(m_jctx);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
- return jctx;
+ return m_jctx;
}
void
Modified: subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp?rev=1496729&r1=1496728&r2=1496729&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp Wed Jun 26 04:38:05 2013
@@ -1576,12 +1576,7 @@ SVNClient::openRemoteSession(const char*
by creating a copy of the prompter here. */
Prompter* prompter = new Prompter(context.getPrompter());
if (!prompter)
- {
- /* context.getSelf() created a new global reference. */
- JNIUtil::getEnv()->DeleteGlobalRef(jctx);
- JNIUtil::throwNullPointerException("allocating Prompter");
- return NULL;
- }
+ return NULL;
jobject jremoteSession = RemoteSession::open(
retryAttempts, path_info.url.c_str(), path_info.uuid.c_str(),
@@ -1589,12 +1584,7 @@ SVNClient::openRemoteSession(const char*
context.getUsername(), context.getPassword(),
prompter, jctx);
if (JNIUtil::isJavaExceptionThrown())
- {
- /* context.getSelf() created a new global reference. */
- JNIUtil::getEnv()->DeleteGlobalRef(jctx);
- jremoteSession = NULL;
- delete prompter;
- }
+ delete prompter;
return jremoteSession;
}