Ticket #2426: fix-trac-2426.patch

File fix-trac-2426.patch, 1.7 KB (added by Echelon9, 10 years ago)

Resolution patch for segmentation fault

  • source/network/tests/test_Net.h

     
    4040        g_VFS = CreateVfs(20 * MiB);
    4141        TS_ASSERT_OK(g_VFS->Mount(L"", DataDir()/"mods"/"public", VFS_MOUNT_MUST_EXIST));
    4242        TS_ASSERT_OK(g_VFS->Mount(L"cache", DataDir()/"_testcache"));
     43        g_ScriptRuntime = ScriptInterface::CreateRuntime(128*MiB);
    4344        CXeromyces::Startup();
    4445
    4546        // Need some stuff for terrain movement costs:
     
    148149        CNetServer server;
    149150
    150151        CScriptValRooted attrs;
    151         scriptInterface.Eval("({mapType:'scenario',map:'_default',thing:'example'})", attrs);
     152        scriptInterface.Eval("({mapType:'scenario',map:'maps/scenarios/Median Oasis 01',mapPath:'maps/scenarios/',thing:'example'})", attrs);
    152153        server.UpdateGameAttributes(attrs.get(), scriptInterface);
    153154
    154155        CNetClient client1(&client1Game);
     
    210211        CNetServer server;
    211212
    212213        CScriptValRooted attrs;
    213         scriptInterface.Eval("({mapType:'scenario',map:'_default',thing:'example'})", attrs);
     214        scriptInterface.Eval("({mapType:'scenario',map:'maps/scenarios/Median Oasis 01',mapPath:'maps/scenarios/',thing:'example'})", attrs);
    214215        server.UpdateGameAttributes(attrs.get(), scriptInterface);
    215216
    216217        CNetClient client1(&client1Game);
  • source/scriptinterface/ScriptInterface.cpp

     
    478478    m_runtime(runtime)
    479479{
    480480    JSBool ok;
     481   
     482    ENSURE(m_runtime);
    481483
    482484    m_cx = JS_NewContext(m_runtime->m_rt, STACK_CHUNK_SIZE);
    483485    ENSURE(m_cx);