mpi.Request: avoid calling JNI free if it is null
This commit was SVN r30806.
Этот коммит содержится в:
родитель
d07d1864ae
Коммит
90625573ff
@ -79,21 +79,8 @@ JNIEXPORT jlong JNICALL Java_mpi_Request_free(
|
|||||||
JNIEnv *env, jobject jthis, jlong handle)
|
JNIEnv *env, jobject jthis, jlong handle)
|
||||||
{
|
{
|
||||||
MPI_Request req = (MPI_Request)handle;
|
MPI_Request req = (MPI_Request)handle;
|
||||||
|
int rc = MPI_Request_free(&req);
|
||||||
if(req != MPI_REQUEST_NULL)
|
ompi_java_exceptionCheck(env, rc);
|
||||||
{
|
|
||||||
if(req == NULL)
|
|
||||||
{
|
|
||||||
req = MPI_REQUEST_NULL;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Handle is NULL when we create a Prequest object. */
|
|
||||||
int rc = MPI_Request_free(&req);
|
|
||||||
ompi_java_exceptionCheck(env, rc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return (jlong)req;
|
return (jlong)req;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,8 +71,11 @@ protected Request(long handle)
|
|||||||
*/
|
*/
|
||||||
@Override public void free() throws MPIException
|
@Override public void free() throws MPIException
|
||||||
{
|
{
|
||||||
MPI.check();
|
if(!isNull())
|
||||||
handle = free(handle);
|
{
|
||||||
|
MPI.check();
|
||||||
|
handle = free(handle);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private native long free(long req) throws MPIException;
|
private native long free(long req) throws MPIException;
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user