[[[ JavaHL: Separated logic for clearing java object cppAddr into its own function as needed by the commit editor C++ objects that require the child to clear the reference and parent to perform deletion
[ in subversion/bindings/javahl/native ] * SVNBase.cpp, SVNBase.h (dispose, disconnectCppObject): Split logic for clearing cppAddr value in the java object into its own function ]]]
Index: subversion/bindings/javahl/native/SVNBase.cpp =================================================================== --- subversion/bindings/javahl/native/SVNBase.cpp (revision 1328758) +++ subversion/bindings/javahl/native/SVNBase.cpp (working copy) @@ -77,7 +77,12 @@ void SVNBase::finalize() void SVNBase::dispose(jobject jthis, jfieldID *fid, const char *className) { + disconnectCppObject(jthis, fid, className); delete this; +} + +void SVNBase::disconnectCppObject(jobject jthis, jfieldID *fid, const char *className) +{ JNIEnv *env = JNIUtil::getEnv(); SVNBase::findCppAddrFieldID(fid, className, env); if (*fid == 0) Index: subversion/bindings/javahl/native/SVNBase.h =================================================================== --- subversion/bindings/javahl/native/SVNBase.h (revision 1328758) +++ subversion/bindings/javahl/native/SVNBase.h (working copy) @@ -83,6 +83,13 @@ class SVNBase */ void dispose(jobject jthis, jfieldID *fid, const char *className); + /** + * Remove cppAddr from the related java object so that it cannot + * try to access disposed object + * @since 1.7.? + */ + void disconnectCppObject(jobject jthis, jfieldID *fid, const char *className); + private: /** * If the value pointed to by @a fid is zero, find the @c jfieldID