From 8031ed7fe1c9de49bafe1022f9a3a17e4f19bc9f Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 18 Dec 2020 19:54:11 -0600 Subject: [PATCH] Run a GC before and after streaming --- app/gui/StreamSegue.qml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/gui/StreamSegue.qml b/app/gui/StreamSegue.qml index 8126a30b..356bb27b 100644 --- a/app/gui/StreamSegue.qml +++ b/app/gui/StreamSegue.qml @@ -97,6 +97,11 @@ Item { streamSegueErrorDialog.open() } } + + // Garbage collect the Session object since it's pretty heavyweight + // and keeps other libraries (like SDL_TTF) around until it is deleted. + session = null + gc() } StackView.onDeactivating: { @@ -153,6 +158,11 @@ Item { // Stop GUI gamepad usage now SdlGamepadKeyNavigation.disable() + // Garbage collect QML stuff before we start streaming, + // since we'll probably be streaming for a while and we + // won't be able to GC during the stream. + gc() + // Run the streaming session to completion session.exec(Screen.virtualX, Screen.virtualY) }