Adds function to HAL to free malloc'd joystick name (#543)

No safe way to do this with interop, so a function is needed.
This commit is contained in:
Thad House
2017-06-30 16:11:16 -07:00
committed by Peter Johnson
parent e4a918850f
commit 462b231dac
3 changed files with 4 additions and 1 deletions

View File

@@ -259,7 +259,7 @@ Java_edu_wpi_first_wpilibj_hal_HAL_getJoystickName(JNIEnv* env, jclass,
NETCOMM_LOG(logDEBUG) << "Calling HAL_GetJoystickName";
char *joystickName = HAL_GetJoystickName(port);
jstring str = MakeJString(env, joystickName);
std::free(joystickName);
HAL_FreeJoystickName(joystickName);
return str;
}