fix: Various invalid iterator and container accesses
This commit is contained in:
parent
921bdd9e3b
commit
87ed0d31d4
@ -1,7 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
project(libimhex)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../external/imgui ${CMAKE_CURRENT_BINARY_DIR}/external/imgui)
|
||||
|
@ -80,7 +80,9 @@ namespace hex {
|
||||
|
||||
if (iter != s_tokenStore.end()) {
|
||||
s_events.remove(*iter->second);
|
||||
s_tokenStore.erase(iter);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
template<typename E>
|
||||
|
@ -189,7 +189,7 @@ namespace hex::fs {
|
||||
#endif
|
||||
}
|
||||
|
||||
constexpr std::vector<std::fs::path> appendPath(std::vector<std::fs::path> paths, const std::fs::path &folder) {
|
||||
std::vector<std::fs::path> appendPath(std::vector<std::fs::path> paths, const std::fs::path &folder) {
|
||||
for (auto &path : paths)
|
||||
path = path / folder;
|
||||
|
||||
|
@ -69,7 +69,7 @@ target_link_libraries(${PROJECT_NAME} PRIVATE libimhex)
|
||||
|
||||
# ---- No need to change anything from here downwards unless you know what you're doing ---- #
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_SHARED_LIBRARY_PREFIX "")
|
||||
set(CMAKE_SHARED_LIBRARY_SUFFIX ".hexplug")
|
||||
|
||||
|
@ -42,7 +42,7 @@ namespace hex::plugin::builtin {
|
||||
}
|
||||
|
||||
void ViewDataInspector::drawContent() {
|
||||
if (this->m_dataValid) {
|
||||
if (this->m_dataValid && !this->m_updateTask.isRunning()) {
|
||||
this->m_dataValid = false;
|
||||
this->m_cachedData = std::move(this->m_workData);
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ namespace hex::plugin::builtin {
|
||||
|
||||
std::array<ImU64, 256> blockValueCounts = { 0 };
|
||||
|
||||
const auto blockCount = provider->getSize() / this->m_blockSize;
|
||||
const auto blockCount = (provider->getSize() / this->m_blockSize) + 1;
|
||||
|
||||
this->m_blockTypeDistributions.fill({});
|
||||
this->m_blockEntropy.clear();
|
||||
|
@ -22,12 +22,13 @@ namespace hex::plugin::builtin {
|
||||
if (ImGui::IsMouseClicked(0) && ImGui::IsItemActivated() && this->m_dragStartIterator == tools.end())
|
||||
this->m_dragStartIterator = iter;
|
||||
|
||||
if (!ImGui::IsMouseDown(0))
|
||||
this->m_dragStartIterator = tools.end();
|
||||
|
||||
if (!ImGui::IsItemHovered() && this->m_dragStartIterator == iter) {
|
||||
detached = true;
|
||||
}
|
||||
|
||||
if (!ImGui::IsMouseDown(0))
|
||||
this->m_dragStartIterator = tools.end();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ if (WIN32)
|
||||
|
||||
# ---- No need to change anything from here downwards unless you know what you're doing ---- #
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_SHARED_LIBRARY_PREFIX "")
|
||||
set(CMAKE_SHARED_LIBRARY_SUFFIX ".hexplug")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user