'Stop current search thread and clean-up'

def stop_and_reset_thread(self, ignore_results=False):

    if (self.search_thread is not None):
        if self.search_thread.isRunning():
            if ignore_results:
                self.search_thread.sig_finished.disconnect(self.search_complete)
            self.search_thread.stop()
            self.search_thread.wait()
        self.search_thread.setParent(None)
        self.search_thread = None
