Guest User

Untitled

a guest
Jul 11th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. lua_pushnil(state);
  2. while (lua_next(state, LUA_GLOBALSINDEX) != 0)
  3. {
  4. dump_stack(state, "start...");
  5. if (lua_type(state, -2) == LUA_TSTRING)
  6. {
  7. const char* k = lua_tostring(state, -2);
  8. printf("unloading %s\n", k);
  9. dump_stack(state, "after get key...")
  10. SharedValue newValue = LuaUtils::ToKrollValue(state); // pops value and converts
  11. dump_stack(state, "after get value...");
  12. SharedValue existingValue = window_global->Get(k);
  13. if (!newValue->Equals(existingValue))
  14. {
  15. window_global->Set(k, newValue);
  16. }
  17. }
  18. else
  19. {
  20. lua_pop(state, 1);
  21. }
  22. dump_stack(state, "end");
  23. }
Add Comment
Please, Sign In to add comment