From 9571e704995912f64af69f32483005e0a93b4e9d Mon Sep 17 00:00:00 2001 From: Cubitect Date: Tue, 7 Dec 2021 22:36:09 +0100 Subject: [PATCH] Fix for the quad-structure search + make target change 1) fix the quad-structure search for large areas did not work correctly 2) changed make clean target to also clean up the cubiomes library --- cubiomes-viewer.pro | 1 + src/searchitem.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/cubiomes-viewer.pro b/cubiomes-viewer.pro index ace1ab7..8726ec8 100644 --- a/cubiomes-viewer.pro +++ b/cubiomes-viewer.pro @@ -25,6 +25,7 @@ win32: { # also compile cubiomes QMAKE_PRE_LINK += $(MAKE) -C $$CUPATH -f $$CUPATH/makefile CFLAGS="-DSTRUCT_CONFIG_OVERRIDE=1" all +QMAKE_CLEAN += $$CUPATH/*.o $$CUPATH/libcubiomes.a TARGET = cubiomes-viewer diff --git a/src/searchitem.cpp b/src/searchitem.cpp index 891b3e5..ea8b890 100644 --- a/src/searchitem.cpp +++ b/src/searchitem.cpp @@ -268,11 +268,15 @@ bool applyTranspose(std::vector& slist, // does the set of candidates for this condition fit in memory? if ((uint64_t)slist.size() * sizeof(int64_t) * w*h >= bufmax) + { + slist.clear(); return false; + } try { list48.resize(slist.size() * w*h); } catch (...) { + slist.clear(); return false; }