[rkward] rkward/windows: Fix potential crash when current focus widget gets destroyed during focus switch.

Thomas Friedrichsmeier null at kde.org
Tue May 5 20:13:10 BST 2020


Git commit f49105d6a104676e070cc56a462f1d840f682cb6 by Thomas Friedrichsmeier.
Committed on 05/05/2020 at 19:12.
Pushed by tfry into branch 'master'.

Fix potential crash when current focus widget gets destroyed during focus switch.

M  +1    -1    rkward/windows/rkmdiwindow.cpp

https://commits.kde.org/rkward/f49105d6a104676e070cc56a462f1d840f682cb6

diff --git a/rkward/windows/rkmdiwindow.cpp b/rkward/windows/rkmdiwindow.cpp
index e777e5f6..3d8c95e1 100644
--- a/rkward/windows/rkmdiwindow.cpp
+++ b/rkward/windows/rkmdiwindow.cpp
@@ -127,7 +127,7 @@ bool RKMDIWindow::isActiveInsideToplevelWindow () {
 void RKMDIWindow::activate (bool with_focus) {
 	RK_TRACE (APP);
 
-	QWidget *old_focus = qApp->focusWidget ();
+	QPointer<QWidget> old_focus = qApp->focusWidget ();
 
 	if (isToolWindow ()) {
 		if (tool_window_bar) tool_window_bar->showWidget (this);



More information about the rkward-tracker mailing list