Last active
November 9, 2018 14:39
-
-
Save sasq64/bceb0eadd39d8b587dc1e470a0928a58 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JNIEXPORT jlong JNICALL Java_com__getComponent(JNIEnv* env, jclass, jstring name) | |
{ | |
std::shared_ptr<Component> component = sm->getComponent(JString{name, env}); | |
if (!component) | |
return 0; | |
return (jlong)(new std::shared_ptr<Component>(component)); | |
} | |
JNIEXPORT void JNICALL Java_com_releaseComponent(JNIEnv*, jclass, jlong component) | |
{ | |
if(component != 0) { | |
std::shared_ptr<Component>* cr = (std::shared_ptr<Component>*)component; | |
delete cr; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment