[rkward-cvs] SF.net SVN: rkward:[3452] trunk/rkward

tfry at users.sourceforge.net tfry at users.sourceforge.net
Mon Feb 21 19:06:41 UTC 2011


Revision: 3452
          http://rkward.svn.sourceforge.net/rkward/?rev=3452&view=rev
Author:   tfry
Date:     2011-02-21 19:06:40 +0000 (Mon, 21 Feb 2011)

Log Message:
-----------
Several environments can share a name (e.g. serveral calls to attach(x))

Modified Paths:
--------------
    trunk/rkward/ChangeLog
    trunk/rkward/rkward/core/robjectlist.cpp

Modified: trunk/rkward/ChangeLog
===================================================================
--- trunk/rkward/ChangeLog	2011-02-21 13:45:04 UTC (rev 3451)
+++ trunk/rkward/ChangeLog	2011-02-21 19:06:40 UTC (rev 3452)
@@ -1,4 +1,5 @@
 --- Version 0.5.5 - XXX-XX-2011
+- Fixed: Crash when several environments on the search path have the same name
 - Re-organize the default toolbar actions of the main window
 - Detached windows are now restored in detached state when restoring the workplace layout
 - Workplace layout is now saved in a separate file, instead of in a hidden object inside the .RData file

Modified: trunk/rkward/rkward/core/robjectlist.cpp
===================================================================
--- trunk/rkward/rkward/core/robjectlist.cpp	2011-02-21 13:45:04 UTC (rev 3451)
+++ trunk/rkward/rkward/core/robjectlist.cpp	2011-02-21 19:06:40 UTC (rev 3452)
@@ -168,6 +168,9 @@
 		QString name = env_names[i];
 
 		RObject* obj = findChildByName (name);
+		if (obj && (i > 0) && (env_names.lastIndexOf (name, i-1) > -1)) {		// duplicate environment names can happen (e.g. if a data.frame is attached multiple times)
+			obj = 0;	// only copy the old item once
+		}
 		if (obj) {
 			// for now, we only update the .GlobalEnv. All others we assume to be static
 			if (obj->isType (GlobalEnv) && force_globalenv_update) {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list