mirror of
https://github.com/corda/corda.git
synced 2025-01-23 12:58:35 +00:00
Merge pull request #271 from dicej/socketexception
don't use GetPrimitiveArrayCritical when throwing SocketExceptions
This commit is contained in:
commit
73bcc766c1
@ -143,9 +143,15 @@ throwSocketException(JNIEnv* e, const char* s)
|
|||||||
void
|
void
|
||||||
throwSocketException(JNIEnv* e, jbyteArray a)
|
throwSocketException(JNIEnv* e, jbyteArray a)
|
||||||
{
|
{
|
||||||
jbyte* s = static_cast<jbyte*>(e->GetPrimitiveArrayCritical(a, 0));
|
size_t length = e->GetArrayLength(a);
|
||||||
throwSocketException(e, reinterpret_cast<const char*>(s));
|
uint8_t* buf = static_cast<uint8_t*>(allocate(e, length));
|
||||||
e->ReleasePrimitiveArrayCritical(a, s, 0);
|
if (buf) {
|
||||||
|
e->GetByteArrayRegion(a, 0, length, reinterpret_cast<jbyte*>(buf));
|
||||||
|
throwSocketException(e, reinterpret_cast<const char*>(buf));
|
||||||
|
free(buf);
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user