Unreal.js

Unreal.JS is always crashing in cooked build.

@nako_sung, sorry to bother you again, but I tried working around this for a couple of days now, but no matter what I do, it always happens.
Here is what I do with custom BP GameInstance (although I tried doing purely on C++ side, then with custom actor and JavaScript component, it’s always the same result):

Here is what I get when exiting the game:

Crash.png

Here is what log says:


LogPlayLevel: ColonyShipGame: [2016.12.13-17.54.25:690][316]LogWindows:Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0xffffffff
LogPlayLevel: ColonyShipGame: [2016.12.13-17.54.25:690][316]LogWindows:Error: LogWindows:Error: ColonyShipGame.exe!UObjectBaseUtility::IsTemplate()
LogPlayLevel: ColonyShipGame: [2016.12.13-17.54.25:690][316]LogWindows:Error: ColonyShipGame.exe!UObjectBaseUtility::IsTemplate()
LogWindows:Error: ColonyShipGame.exe!UJavascriptIsolate::~UJavascriptIsolate() [c:\work\epic games\projects\colonyshipgame\plugins\unrealjs\source\v8\private\v8implementation.cpp:44]
LogPlayLevel: ColonyShipGame: [2016.12.13-17.54.25:690][316]LogWindows:Error: ColonyShipGame.exe!UJavascriptIsolate::~UJavascriptIsolate() [c:\work\epic games\projects\colonyshipgame\plugins\unrealjs\source\v8\private\v8implementation.cpp:44]
LogWindows:Error: ColonyShipGame.exe!UJavascriptIsolate::`scalar deleting destructor'()
LogPlayLevel: ColonyShipGame: [2016.12.13-17.54.25:690][316]LogWindows:Error: ColonyShipGame.exe!UJavascriptIsolate::`scalar deleting destructor'()
LogWindows:Error: ColonyShipGame.exe!IncrementalPurgeGarbage()
LogPlayLevel: ColonyShipGame: [2016.12.13-17.54.25:690][316]LogWindows:Error: ColonyShipGame.exe!IncrementalPurgeGarbage()
LogWindows:Error: ColonyShipGame.exe!StaticExit()
...


Having moved the plugin to project’s folder and after adding a breakpoint to ~UJavascriptIsolate(), I can see that the destructor is called twice, which is a reason for the crash. But why does that happen, and why it doesn’t happen in PIE is a mystery to me. Perhaps you have an idea.