[rkward] rkward/plugin: Fix crash in formula editing widget.

Thomas Friedrichsmeier null at kde.org
Sun Jun 4 18:49:25 UTC 2017


Git commit 849ea81317392ca625e82efe5e55f94dab8486e8 by Thomas Friedrichsmeier.
Committed on 04/06/2017 at 18:46.
Pushed by tfry into branch 'master'.

Fix crash in formula editing widget.

Note to the bug reporter: This element is unsused so far, so the crash
was not triggered, yet. But many thanks for the the pointer!

BUG: 366323

M  +3    -1    rkward/plugin/rkformula.cpp

https://commits.kde.org/rkward/849ea81317392ca625e82efe5e55f94dab8486e8

diff --git a/rkward/plugin/rkformula.cpp b/rkward/plugin/rkformula.cpp
index bb82618c..09e5584e 100644
--- a/rkward/plugin/rkformula.cpp
+++ b/rkward/plugin/rkformula.cpp
@@ -382,6 +382,7 @@ void RKFormula::checkCustomModel () {
 		level_box->setMaximum (0);
 	}
 
+	InteractionMap new_map = interaction_map;
 	// clear terms which are no longer valid
 	for (InteractionMap::iterator in = interaction_map.begin (); in != interaction_map.end (); ++in) {
 		Interaction inter = in.value ();
@@ -397,9 +398,10 @@ void RKFormula::checkCustomModel () {
 		}
 		if (found_vars < (inter.level + 1)) {
 			delete (in.key ());
-			interaction_map.erase (in);
+			new_map.remove (in.key ());
 		}
 	}
+	interaction_map = new_map;
 }
 
 bool RKFormula::isValid () {



More information about the rkward-tracker mailing list