PR feedback

This commit is contained in:
Nabil Hachicha 2016-02-19 22:50:30 +00:00
parent 76981229ab
commit 9bcebfaf29
3 changed files with 11 additions and 13 deletions

View File

@ -58,13 +58,12 @@ public class RealmReactModule extends ReactContextBaseJavaModule {
if (!isContextInjected()) {
startWebServer();
}
startWebServer();
return Collections.EMPTY_MAP;
}
@Override
public void onCatalystInstanceDestroy() {
clearFlag();
clearContextInjectedFlag();
stopWebServer();
}
@ -133,7 +132,7 @@ public class RealmReactModule extends ReactContextBaseJavaModule {
private native boolean isContextInjected();
// clear the flag set when injecting Realm API
private native void clearFlag();
private native void clearContextInjectedFlag();
// fileDir: path of the internal storage of the application
private native void setDefaultRealmFileDirectory(String fileDir);

View File

@ -50,13 +50,12 @@ JNIEXPORT jstring JNICALL Java_io_realm_react_RealmReactModule_processChromeDebu
JNIEXPORT jboolean JNICALL Java_io_realm_react_RealmReactModule_isContextInjected
(JNIEnv *env, jclass)
{
return realmContextInjected;
}
{
return realmContextInjected;
}
JNIEXPORT void JNICALL Java_io_realm_react_RealmReactModule_clearFlag
JNIEXPORT void JNICALL Java_io_realm_react_RealmReactModule_clearContextInjectedFlag
(JNIEnv *env, jclass)
{
realmContextInjected = false;//might not be needed
}
{
realmContextInjected = false;
}

View File

@ -38,9 +38,9 @@ JNIEXPORT jboolean JNICALL Java_io_realm_react_RealmReactModule_isContextInjecte
/*
* Class: io_realm_react_RealmReactModule
* Method: clearFlag
* Method: clearContextInjectedFlag
*/
JNIEXPORT void JNICALL Java_io_realm_react_RealmReactModule_clearFlag
JNIEXPORT void JNICALL Java_io_realm_react_RealmReactModule_clearContextInjectedFlag
(JNIEnv *, jclass);