Memory leak fixes in api and nfc, location tag fix

Fixes multiple potential memory leaks in API and NFC. Also fixes an issue in the new locaiton tag feature that could lead to multiple parallel API requests. This could cause memory leak issues but also result in wrong weights being registered for a spool.
This commit is contained in:
Jan Philipp Ecker
2025-07-26 22:36:04 +02:00
parent 8343fe887b
commit f038020042
4 changed files with 41 additions and 11 deletions

View File

@@ -212,14 +212,14 @@ void loop() {
lastWeight = weight;
// Wenn ein Tag mit SM id erkannte wurde und der Waage Counter anspricht an SM Senden
if (spoolId != "" && weigthCouterToApi > 3 && weightSend == 0 && nfcReaderState == NFC_READ_SUCCESS) {
if (activeSpoolId != "" && weigthCouterToApi > 3 && weightSend == 0 && nfcReaderState == NFC_READ_SUCCESS) {
oledShowIcon("loading");
if (updateSpoolWeight(spoolId, weight))
if (updateSpoolWeight(activeSpoolId, weight))
{
oledShowIcon("success");
vTaskDelay(2000 / portTICK_PERIOD_MS);
weightSend = 1;
autoSetToBambuSpoolId = spoolId.toInt();
autoSetToBambuSpoolId = activeSpoolId.toInt();
if (octoEnabled)
{