Skip to content

Commit

Permalink
ReleaseStringUTFChars
Browse files Browse the repository at this point in the history
  • Loading branch information
pqpo committed Dec 20, 2018
1 parent 61abacb commit eeba636
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions librarylog4a/src/main/cpp/log4a-lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ static jlong initNative(JNIEnv *env, jclass type, jstring buffer_path_,
buffer_ptr = new char[buffer_size];
map_buffer = false;
}
env->ReleaseStringUTFChars(buffer_path_, buffer_path);
env->ReleaseStringUTFChars(log_path_, log_path);

LogBuffer* logBuffer = new LogBuffer(buffer_ptr, buffer_size);
logBuffer->setAsyncFileFlush(fileFlush);
//将buffer内的数据清0, 并写入日志文件路径
logBuffer->initData((char *) log_path, strlen(log_path), compress_);
logBuffer->map_buffer = map_buffer;

env->ReleaseStringUTFChars(buffer_path_, buffer_path);
env->ReleaseStringUTFChars(log_path_, log_path);
return reinterpret_cast<long>(logBuffer);
}

Expand Down

0 comments on commit eeba636

Please sign in to comment.