3
3
* ====================================================================
4
* Copyright (c) 2003-2006 CollabNet. All rights reserved.
6
* This software is licensed as described in the file COPYING, which
7
* you should have received as part of this distribution. The terms
8
* are also available at http://subversion.tigris.org/license-1.html.
9
* If newer versions of this license are posted there, you may use a
10
* newer version instead, at your option.
12
* This software consists of voluntary contributions made by many
13
* individuals. For exact contribution history, see the revision
14
* history and logs, available at http://subversion.tigris.org/.
4
* Licensed to the Apache Software Foundation (ASF) under one
5
* or more contributor license agreements. See the NOTICE file
6
* distributed with this work for additional information
7
* regarding copyright ownership. The ASF licenses this file
8
* to you under the Apache License, Version 2.0 (the
9
* "License"); you may not use this file except in compliance
10
* with the License. You may obtain a copy of the License at
12
* http://www.apache.org/licenses/LICENSE-2.0
14
* Unless required by applicable law or agreed to in writing,
15
* software distributed under the License is distributed on an
16
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17
* KIND, either express or implied. See the License for the
18
* specific language governing permissions and limitations
15
20
* ====================================================================
49
57
jlong cppAddr = env->GetLongField(jthis, *fid);
50
return (JNIUtil::isJavaExceptionThrown() ? 0 : cppAddr);
58
if (JNIUtil::isJavaExceptionThrown())
63
/* jthis is not guaranteed to be the same between JNI invocations, so
64
we do a little dance here and store the updated version in our
65
object for this invocation.
67
findCppAddrForJObject() is, by necessity, called before any other
68
methods on the C++ object, so by doing this we can guarantee a
69
valid jthis pointer for subsequent uses. */
70
(reinterpret_cast<SVNBase *> (cppAddr))->jthis = jthis;
60
82
JNIUtil::enqueueForDeletion(this);
63
void SVNBase::dispose(jobject jthis, jfieldID *fid, const char *className)
85
void SVNBase::dispose(jfieldID *fid, const char *className)
87
jobject my_jthis = this->jthis;
66
90
JNIEnv *env = JNIUtil::getEnv();
67
91
SVNBase::findCppAddrFieldID(fid, className, env);
71
env->SetLongField(jthis, *fid, 0);
95
env->SetLongField(my_jthis, *fid, 0);
72
96
if (JNIUtil::isJavaExceptionThrown())