mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
Solve some safety issues with RPCs (#1127)
Java would never properly dispose, and C++'s were easy to respond after disposing. We now return a bool if the call was successful or not.
This commit is contained in:
committed by
Peter Johnson
parent
6aebba5452
commit
8eafe7f325
@@ -1255,17 +1255,17 @@ Java_edu_wpi_first_networktables_NetworkTablesJNI_waitForRpcCallQueue
|
||||
/*
|
||||
* Class: edu_wpi_first_networktables_NetworkTablesJNI
|
||||
* Method: postRpcResponse
|
||||
* Signature: (II[B)V
|
||||
* Signature: (II[B)Z
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_networktables_NetworkTablesJNI_postRpcResponse
|
||||
(JNIEnv* env, jclass, jint entry, jint call, jbyteArray result)
|
||||
{
|
||||
if (!result) {
|
||||
nullPointerEx.Throw(env, "result cannot be null");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
nt::PostRpcResponse(entry, call, JByteArrayRef{env, result});
|
||||
return nt::PostRpcResponse(entry, call, JByteArrayRef{env, result});
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user