Fix bug, if no mac games exist + small memory leak
This commit is contained in:
parent
af8da372de
commit
0698231ca0
2 changed files with 9 additions and 7 deletions
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue