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)
|
||||
{
|
||||
MPI_Request req = (MPI_Request)handle;
|
||||
|
||||
if(req != MPI_REQUEST_NULL)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
int rc = MPI_Request_free(&req);
|
||||
ompi_java_exceptionCheck(env, rc);
|
||||
return (jlong)req;
|
||||
}
|
||||
|
||||
|
@ -71,8 +71,11 @@ protected Request(long handle)
|
||||
*/
|
||||
@Override public void free() throws MPIException
|
||||
{
|
||||
MPI.check();
|
||||
handle = free(handle);
|
||||
if(!isNull())
|
||||
{
|
||||
MPI.check();
|
||||
handle = free(handle);
|
||||
}
|
||||
}
|
||||
|
||||
private native long free(long req) throws MPIException;
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user