Fix emscripten entry/exit points;
#include <stdlib.h>
lua_State* lovrInit(lua_State* L, int argc, char** argv);
-void lovrQuit(int status);
+void lovrDestroy(void* arg);
int main(int argc, char** argv);
#ifndef LOVR_USE_OCULUS_MOBILE
@@ -24,11 +24,13 @@ typedef struct {
} lovrEmscriptenContext;
void lovrDestroy(void* arg) {
+ if (arg) {
lovrEmscriptenContext* context = arg;
lua_State* L = context->L;
emscripten_cancel_main_loop();
lua_close(L);
}
+}
static void emscriptenLoop(void* arg) {
lovrEmscriptenContext* context = arg;
