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/19 08:47:51 UTC

svn commit: r1494472 - /subversion/branches/javahl-ra/subversion/bindings/javahl/native/SVNClient.cpp

Author: brane
Date: Wed Jun 19 06:47:50 2013
New Revision: 1494472

URL: http://svn.apache.org/r1494472
Log:
On the javahl-ra branch: Fix a pool-lifetime-related bug.

* subversion/bindings/javahl/native/SVNClient.cpp
  (SVNClient::openRemoteSession): In the info receiver callback, create a
   local copy of the url and uuid strings.

Modified:
    subversion/branches/javahl-ra/subversion/bindings/javahl/native/SVNClient.cpp

Modified: subversion/branches/javahl-ra/subversion/bindings/javahl/native/SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/javahl/native/SVNClient.cpp?rev=1494472&r1=1494471&r2=1494472&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/bindings/javahl/native/SVNClient.cpp (original)
+++ subversion/branches/javahl-ra/subversion/bindings/javahl/native/SVNClient.cpp Wed Jun 19 06:47:50 2013
@@ -71,6 +71,7 @@
 #include <vector>
 #include <iostream>
 #include <sstream>
+#include <string>
 
 
 SVNClient::SVNClient(jobject jthis_in)
@@ -1544,8 +1545,8 @@ SVNClient::openRemoteSession(const char*
 
     struct PathInfo
     {
-        const char *url;
-        const char *uuid;
+        std::string url;
+        std::string uuid;
         static svn_error_t *callback(void *baton,
                                      const char *,
                                      const svn_client_info2_t *info,
@@ -1563,7 +1564,8 @@ SVNClient::openRemoteSession(const char*
                     (svn_path_is_url(checkedPath.c_str()) ? &HEAD : &NONE),
                     svn_depth_empty, FALSE, TRUE, NULL,
                     PathInfo::callback, &path_info,
-                    ctx, subPool.getPool()), NULL);
+                    ctx, subPool.getPool()),
+                NULL);
 
     jobject jctx = context.getSelf();
     if (JNIUtil::isJavaExceptionThrown())
@@ -1581,7 +1583,7 @@ SVNClient::openRemoteSession(const char*
     }
 
     jobject jremoteSession = RemoteSession::open(
-        retryAttempts, path_info.url, path_info.uuid,
+        retryAttempts, path_info.url.c_str(), path_info.uuid.c_str(),
         context.getConfigDirectory(),
         context.getUsername(), context.getPassword(),
         prompter, jctx);