Skip to content

Commit

Permalink
Remove reference to current search object when search ends
Browse files Browse the repository at this point in the history
  • Loading branch information
Phoenix616 committed Nov 4, 2020
1 parent 52b6179 commit 1415cc4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/de/themoep/entitydetection/EntityDetection.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public boolean stopSearch(String stopper) {
return false;
}
currentSearch.stop(stopper);
clearCurrentSearch();
return true;
}

Expand All @@ -92,6 +93,10 @@ public void addResult(SearchResult<?> result) {
}
}

public void clearCurrentSearch() {
currentSearch = null;
}

public EntitySearch getCurrentSearch() {
return currentSearch;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,5 +173,6 @@ public void run() {
plugin.addResult(result);
plugin.send(owner, result);
running = false;
plugin.clearCurrentSearch();
}
}

0 comments on commit 1415cc4

Please sign in to comment.