[rkward-cvs] [rkward/development/plugin_management_to_loadlibs] rkward/plugin: When clearing component map, also clear contexts.

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Wed Dec 31 21:02:48 UTC 2014


Git commit dc9e2e8c1f7ff33d50865a33ad9c31185c7c235a by Thomas Friedrichsmeier.
Committed on 31/12/2014 at 21:02.
Pushed by tfry into branch 'development/plugin_management_to_loadlibs'.

When clearing component map, also clear contexts.

M  +5    -1    rkward/plugin/rkcomponentmap.cpp

http://commits.kde.org/rkward/dc9e2e8c1f7ff33d50865a33ad9c31185c7c235a

diff --git a/rkward/plugin/rkcomponentmap.cpp b/rkward/plugin/rkcomponentmap.cpp
index e0692b8..4dc1cf2 100644
--- a/rkward/plugin/rkcomponentmap.cpp
+++ b/rkward/plugin/rkcomponentmap.cpp
@@ -318,7 +318,7 @@ void RKComponentMap::clearAll () {
 	RK_TRACE (PLUGIN);
 
 	actionCollection ()->clear ();
-	for (ComponentMap::iterator it = components.begin (); it != components.end (); ++it) {
+	for (ComponentMap::const_iterator it = components.constBegin (); it != components.constEnd (); ++it) {
 		delete (it.value ());
 /* TODO: this is not technically correct, as there may be several actions for this id, and we're only deleting one. But practically this should not really be relevant. */
 		delete (actionCollection ()->action (it.key ()));
@@ -331,6 +331,10 @@ void RKComponentMap::clearAll () {
 	pluginmapfiles.clear ();
 	component_attributes.clear ();
 	component_dependencies.clear ();
+	for (RKComponentContextMap::const_iterator it = contexts.constBegin (); it != contexts.constEnd (); ++it) {
+		delete (it.value ());
+	}
+	contexts.clear ();
 
 	clearGUIDescription ();
 





More information about the rkward-tracker mailing list