1
0
Fork 0
mirror of synced 2024-06-26 10:11:19 +12:00

Fix bug, if no mac games exist + small memory leak

This commit is contained in:
Dummerle 2022-01-04 21:35:45 +01:00
parent af8da372de
commit 0698231ca0
No known key found for this signature in database
GPG key ID: AB68CC59CA39F2F1
2 changed files with 9 additions and 7 deletions

View file

@ -41,12 +41,14 @@ class ApiRequestWorker(QRunnable):
self.setAutoDelete(True)
def run(self) -> None:
try:
result = shared.core.get_game_and_dlc_list(True, "Mac")
except HTTPError:
result = [], {}
self.signals.result.emit(result, "mac")
if platform.system() == "Darwin" or "Mac" in shared.core.get_installed_platforms():
try:
result = shared.core.get_game_and_dlc_list(True, "Mac")
except HTTPError:
result = [], {}
self.signals.result.emit(result, "mac")
else:
self.signals.result.emit(([], {}), "mac")
try:
result = shared.core.get_game_and_dlc_list(True, "Win32")
except HTTPError:

View file

@ -48,7 +48,7 @@ class SearchResults(QStackedWidget):
self.api_core.search_game(text, self.show_results)
def show_results(self, results: dict):
QVBoxLayout().addWidget(self.widget)
self.widget.deleteLater()
self.widget = QWidget()
self.layout = FlowLayout()
if not results: