aboutsummaryrefslogtreecommitdiffstats
path: root/sample-android/templates/initclass_postamble.kte
blob: 4d416c3e2062f0a4d8d1fdd5ff2c3a9f97d30994 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
@import io.github.landerlyoung.jenny.JteData
@import io.github.landerlyoung.jenny.Constants
@import io.github.landerlyoung.jenny.HandyHelper
@import io.github.landerlyoung.jenny.MethodOverloadResolver.MethodRecord
@import javax.lang.model.type.TypeKind

@param jteData: JteData
            state.sInited = true;
        }
@if (jteData.environment.configurations.threadSafe)
    }
@endif
#undef JENNY_CHECK_NULL
   return true;
}

${jteData.initClassPrefix} void ${jteData.className}::releaseClazz(JNIEnv* env) {
    auto& state = getClassInitState();
    if (state.sInited) {
        ${jteData.initClassLockGuard}
        if (state.sInited) {
            env->DeleteGlobalRef(state.sClazz);
            state.sClazz = nullptr;
            state.sInited = false;
        }
    }
}