From 1415cc448a6df1e7ab7691fb0502f8fc009ede17 Mon Sep 17 00:00:00 2001 From: Phoenix616 Date: Wed, 4 Nov 2020 22:23:16 +0100 Subject: [PATCH] Remove reference to current search object when search ends --- .../java/de/themoep/entitydetection/EntityDetection.java | 5 +++++ .../de/themoep/entitydetection/searcher/EntitySearch.java | 1 + 2 files changed, 6 insertions(+) diff --git a/src/main/java/de/themoep/entitydetection/EntityDetection.java b/src/main/java/de/themoep/entitydetection/EntityDetection.java index 8038bf1..85432f3 100644 --- a/src/main/java/de/themoep/entitydetection/EntityDetection.java +++ b/src/main/java/de/themoep/entitydetection/EntityDetection.java @@ -80,6 +80,7 @@ public boolean stopSearch(String stopper) { return false; } currentSearch.stop(stopper); + clearCurrentSearch(); return true; } @@ -92,6 +93,10 @@ public void addResult(SearchResult result) { } } + public void clearCurrentSearch() { + currentSearch = null; + } + public EntitySearch getCurrentSearch() { return currentSearch; } diff --git a/src/main/java/de/themoep/entitydetection/searcher/EntitySearch.java b/src/main/java/de/themoep/entitydetection/searcher/EntitySearch.java index 0c54061..cf756ce 100644 --- a/src/main/java/de/themoep/entitydetection/searcher/EntitySearch.java +++ b/src/main/java/de/themoep/entitydetection/searcher/EntitySearch.java @@ -173,5 +173,6 @@ public void run() { plugin.addResult(result); plugin.send(owner, result); running = false; + plugin.clearCurrentSearch(); } }