mirror of
https://github.com/onionshare/onionshare.git
synced 2024-10-01 01:35:40 -04:00
Only close web thread on cleanup if web thread exists, and sleep 1 second when cleaning up MainWindow so loose threads can finish
This commit is contained in:
parent
f67e7ce678
commit
09d1118a94
@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
||||
import time
|
||||
from PySide2 import QtCore, QtWidgets, QtGui
|
||||
|
||||
from onionshare_cli.web import Web
|
||||
@ -286,3 +287,6 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
def cleanup(self):
|
||||
self.tabs.cleanup()
|
||||
self.common.gui.onion.cleanup()
|
||||
|
||||
# Wait 1 second for threads to close gracefully, so tests finally pass
|
||||
time.sleep(1)
|
||||
|
@ -663,6 +663,7 @@ class Tab(QtWidgets.QWidget):
|
||||
return False
|
||||
|
||||
def cleanup(self):
|
||||
self.get_mode().web_thread.quit()
|
||||
self.get_mode().web_thread.wait()
|
||||
if self.get_mode() and self.get_mode().web_thread:
|
||||
self.get_mode().web_thread.quit()
|
||||
self.get_mode().web_thread.wait()
|
||||
self.app.cleanup()
|
||||
|
Loading…
Reference in New Issue
Block a user