mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-03 17:59:33 +02:00
fixed crash in native code
This commit is contained in:
parent
a9610d892c
commit
0448971a1c
2 changed files with 9 additions and 3 deletions
|
@ -86,9 +86,8 @@ JNIEXPORT jboolean JNICALL Java_org_geometerplus_fbreader_formats_NativeFormatPl
|
||||||
return JNI_FALSE;
|
return JNI_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return JNI_FALSE;
|
|
||||||
|
|
||||||
shared_ptr<Book> book = Book::loadFromJavaBook(env, javaBook);
|
shared_ptr<Book> book = Book::loadFromJavaBook(env, javaBook);
|
||||||
|
|
||||||
if (!plugin->readMetaInfo(*book)) {
|
if (!plugin->readMetaInfo(*book)) {
|
||||||
return JNI_FALSE;
|
return JNI_FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,8 +21,15 @@
|
||||||
|
|
||||||
#include <AndroidUtil.h>
|
#include <AndroidUtil.h>
|
||||||
|
|
||||||
|
#include <ZLibrary.h>
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *jvm, void *reserved) {
|
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *jvm, void *reserved) {
|
||||||
AndroidUtil::init(jvm);
|
if (AndroidUtil::init(jvm)) {
|
||||||
|
int argc = 0;
|
||||||
|
char **argv = 0;
|
||||||
|
ZLibrary::init(argc, argv);
|
||||||
|
ZLibrary::initApplication("FBReader");
|
||||||
|
}
|
||||||
return JNI_VERSION_1_2;
|
return JNI_VERSION_1_2;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue