diff --git a/Source/Engine/Level/Level.cpp b/Source/Engine/Level/Level.cpp index 9cf6794be..a873ae734 100644 --- a/Source/Engine/Level/Level.cpp +++ b/Source/Engine/Level/Level.cpp @@ -428,7 +428,9 @@ void LevelService::LateFixedUpdate() void LevelService::Dispose() { + // End scene actions ScopeLock lock(_sceneActionsLocker); + _sceneActions.ClearDelete(); // Unload scenes unloadScenes(); diff --git a/Source/Engine/Platform/Base/StringUtilsBase.cpp b/Source/Engine/Platform/Base/StringUtilsBase.cpp index e86968edf..96f0fd2dc 100644 --- a/Source/Engine/Platform/Base/StringUtilsBase.cpp +++ b/Source/Engine/Platform/Base/StringUtilsBase.cpp @@ -357,6 +357,8 @@ StringView StringUtils::GetPathWithoutExtension(const StringView& path) void StringUtils::PathRemoveRelativeParts(String& path) { FileSystem::NormalizePath(path); + if (path.Length() == 1 && path[0] == TEXT('/')) + return; Array components; path.Split(TEXT('/'), components); diff --git a/Source/Engine/Platform/Base/ThreadBase.cpp b/Source/Engine/Platform/Base/ThreadBase.cpp index 6cbb32f8b..e4ccd2856 100644 --- a/Source/Engine/Platform/Base/ThreadBase.cpp +++ b/Source/Engine/Platform/Base/ThreadBase.cpp @@ -45,6 +45,11 @@ void ThreadBase::Kill(bool waitForJoin) if (!_isRunning) { ClearHandleInternal(); + if (_callAfterWork) + { + _callAfterWork = false; + _runnable->AfterWork(true); + } return; } ASSERT(GetID()); diff --git a/Source/Engine/Platform/Unix/UnixThread.cpp b/Source/Engine/Platform/Unix/UnixThread.cpp index ff6e61b2a..d1115ca33 100644 --- a/Source/Engine/Platform/Unix/UnixThread.cpp +++ b/Source/Engine/Platform/Unix/UnixThread.cpp @@ -1,6 +1,6 @@ // Copyright (c) Wojciech Figat. All rights reserved. -#if PLATFORM_UNIX +#if PLATFORM_UNIX && !PLATFORM_WEB #include "UnixThread.h" #include "Engine/Core/Log.h" diff --git a/Source/Engine/Platform/Unix/UnixThread.h b/Source/Engine/Platform/Unix/UnixThread.h index c7f4295aa..52906e1eb 100644 --- a/Source/Engine/Platform/Unix/UnixThread.h +++ b/Source/Engine/Platform/Unix/UnixThread.h @@ -2,7 +2,7 @@ #pragma once -#if PLATFORM_UNIX +#if PLATFORM_UNIX && !PLATFORM_WEB #include "Engine/Platform/Base/ThreadBase.h" #include diff --git a/Source/Engine/Platform/Web/WebPlatform.cpp b/Source/Engine/Platform/Web/WebPlatform.cpp index 8c7aed48f..286639a0b 100644 --- a/Source/Engine/Platform/Web/WebPlatform.cpp +++ b/Source/Engine/Platform/Web/WebPlatform.cpp @@ -7,7 +7,6 @@ #include "Engine/Core/Log.h" #include "Engine/Core/Types/String.h" #include "Engine/Core/Types/Version.h" -#include "Engine/Core/Types/TimeSpan.h" #include "Engine/Core/Types/Guid.h" #include "Engine/Platform/CPUInfo.h" #include "Engine/Platform/MemoryStats.h" @@ -52,7 +51,7 @@ MemoryStats WebPlatform::GetMemoryStats() MemoryStats result; result.TotalPhysicalMemory = emscripten_get_heap_max(); result.UsedPhysicalMemory = emscripten_get_heap_size(); - result.TotalVirtualMemory = result.TotalPhysicalMemory; + result.TotalVirtualMemory = 2ull * 1024 * 1024 * 1024; // Max 2GB result.UsedVirtualMemory = result.UsedPhysicalMemory; result.ProgramSizeMemory = 0; return result; diff --git a/Source/Engine/Platform/Web/WebPlatform.h b/Source/Engine/Platform/Web/WebPlatform.h index af4f3c146..7361d066a 100644 --- a/Source/Engine/Platform/Web/WebPlatform.h +++ b/Source/Engine/Platform/Web/WebPlatform.h @@ -77,7 +77,7 @@ public: #ifdef __EMSCRIPTEN_PTHREADS__ return (uint64)pthread_self(); #else - return 0; + return 1; #endif } static String GetSystemName(); diff --git a/Source/ThirdParty/recastnavigation/DetourNavMesh.cpp b/Source/ThirdParty/recastnavigation/DetourNavMesh.cpp index eba1b4dc3..869f165ca 100644 --- a/Source/ThirdParty/recastnavigation/DetourNavMesh.cpp +++ b/Source/ThirdParty/recastnavigation/DetourNavMesh.cpp @@ -232,8 +232,8 @@ dtStatus dtNavMesh::init(const dtNavMeshParams* params) m_posLookup = (dtMeshTile**)dtAlloc(sizeof(dtMeshTile*)*m_tileLutSize, DT_ALLOC_PERM); if (!m_posLookup) return DT_FAILURE | DT_OUT_OF_MEMORY; - memset(m_tiles, 0, sizeof(dtMeshTile)*m_maxTiles); - memset(m_posLookup, 0, sizeof(dtMeshTile*)*m_tileLutSize); + memset((void*)m_tiles, 0, sizeof(dtMeshTile)*m_maxTiles); + memset((void*)m_posLookup, 0, sizeof(dtMeshTile*)*m_tileLutSize); m_nextFree = 0; for (int i = m_maxTiles-1; i >= 0; --i) {