You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
I am currently working on embedding jxcore to my robotic system program.When i am testing embedding api ,i produced the following code:
include "stdafx.h"
include "ScriptEngine.h"
include <windows.h>
include "thread"
include "mutex"
int main(int argc, char **args) {
char* homeFolder = args[0];
JX_InitializeOnce(homeFolder);
JX_InitializeNewEngine();
JX_DefineMainFile("console.log('parent engine')");
JXValue obj;
**# // Parent engine created at main thread ,and JX_CreateEmptyObject worked ok!**
JX_CreateEmptyObject(&obj);
JXValue global;
JX_GetGlobalObject(&global);
JX_SetNamedProperty(&global, "NativeBridge", &obj);
JX_Free(&obj);
JX_Free(&global);
JX_StartEngine();
//create a new engine instance and attach it to a new thread
thread t1 (create_new_engine);
t1.join();
Sleep(10 * 1000);
}
void create_new_engine() {
string homeFolder = "";
JX_InitializeNewEngine();
JX_DefineMainFile("console.log('sub engine')");
JX_StartEngine();
JXValue obj1;
**# // sub engine created at new thread ,and JX_CreateEmptyObject called fail!**
//Exception thrown: read access violation.
//__imp_TlsGetValue(...) returned nullptr.
//program break at :
//JXCORE_EXTERN(bool)
//JX_CreateEmptyObject(JXValue *value) {
// node::commons *com = node::commons::getInstance();
JX_CreateEmptyObject(&obj1);
JXValue global;
JX_GetGlobalObject(&global);
JX_SetNamedProperty(&global, "NativeBridge", &obj1);
JX_Free(&obj1);
JX_Free(&global);
JX_Loop();
JX_StopEngine();
}
My working enviroment is : windows 10 ,visual studio 2015,runing in vm fusion on mac
Thanks.
The text was updated successfully, but these errors were encountered:
Hi
I am currently working on embedding jxcore to my robotic system program.When i am testing embedding api ,i produced the following code:
include "stdafx.h"
include "ScriptEngine.h"
include <windows.h>
include "thread"
include "mutex"
int main(int argc, char **args) {
}
void create_new_engine() {
}
My working enviroment is : windows 10 ,visual studio 2015,runing in vm fusion on mac
Thanks.
The text was updated successfully, but these errors were encountered: