[rkward/frameworks] rkward/core: Never remove root level objects (esp. .GlobalEnv).

Thomas Friedrichsmeier null at kde.org
Sun Jun 4 19:39:59 UTC 2017


Git commit e533e879e11fccbb745d1049ddf0d423f4fdf91e by Thomas Friedrichsmeier.
Committed on 04/06/2017 at 19:38.
Pushed by tfry into branch 'frameworks'.

Never remove root level objects (esp. .GlobalEnv).

Prevents frontend crash in case of backend start failure.

M  +4    -1    rkward/core/rkmodificationtracker.cpp

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

diff --git a/rkward/core/rkmodificationtracker.cpp b/rkward/core/rkmodificationtracker.cpp
index b30a38ea..bd80eff7 100644
--- a/rkward/core/rkmodificationtracker.cpp
+++ b/rkward/core/rkmodificationtracker.cpp
@@ -94,7 +94,10 @@ bool RKModificationTracker::removeObject (RObject *object, RKEditor *editor, boo
 	}
 
 	RK_ASSERT (object);
-	RK_ASSERT (object->parentObject ());
+	if (!object->parentObject ()) {
+		RK_DEBUG (OBJECTS, DL_ERROR, "Trying to remove root level object. Backend crashed?");
+		return false;
+	}
 	bool view_update = !updates_locked && !object->isType (RObject::NonVisibleObject);
 
 	if (view_update) {



More information about the rkward-tracker mailing list