mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-21 21:52:11 +00:00
Fixing a leak in OnnxSequences with String keys or values. (#6473)
This commit is contained in:
parent
d850fa63bf
commit
77d0eb3f56
1 changed files with 3 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
#include <jni.h>
|
||||
|
|
@ -28,6 +28,7 @@ JNIEXPORT jobjectArray JNICALL Java_ai_onnxruntime_OnnxSequence_getStringKeys
|
|||
jobjectArray output = createStringArrayFromTensor(jniEnv, api, allocator, keys);
|
||||
|
||||
api->ReleaseValue(keys);
|
||||
api->ReleaseValue(element);
|
||||
|
||||
return output;
|
||||
}
|
||||
|
|
@ -80,6 +81,7 @@ JNIEXPORT jobjectArray JNICALL Java_ai_onnxruntime_OnnxSequence_getStringValues
|
|||
jobjectArray output = createStringArrayFromTensor(jniEnv, api, allocator, values);
|
||||
|
||||
api->ReleaseValue(values);
|
||||
api->ReleaseValue(element);
|
||||
|
||||
return output;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue