[rkward-cvs] SF.net SVN: rkward:[2878] trunk/rkward/rkward/dataeditor/rkvareditmodel.cpp

tfry at users.sourceforge.net tfry at users.sourceforge.net
Tue Jun 15 12:36:32 UTC 2010


Revision: 2878
          http://rkward.svn.sourceforge.net/rkward/?rev=2878&view=rev
Author:   tfry
Date:     2010-06-15 12:36:32 +0000 (Tue, 15 Jun 2010)

Log Message:
-----------
Do not crash, if edited object is removed

Modified Paths:
--------------
    trunk/rkward/rkward/dataeditor/rkvareditmodel.cpp

Modified: trunk/rkward/rkward/dataeditor/rkvareditmodel.cpp
===================================================================
--- trunk/rkward/rkward/dataeditor/rkvareditmodel.cpp	2010-06-15 12:05:24 UTC (rev 2877)
+++ trunk/rkward/rkward/dataeditor/rkvareditmodel.cpp	2010-06-15 12:36:32 UTC (rev 2878)
@@ -35,6 +35,7 @@
 	meta_model = 0;
 	trailing_rows = trailing_cols = 0;
 	edit_blocks = 0;
+	rownames = 0;
 
 	addNotificationType (RObjectListener::ObjectRemoved);
 	addNotificationType (RObjectListener::MetaChanged);
@@ -738,8 +739,8 @@
 RKVarEditDataFrameModel::~RKVarEditDataFrameModel () {
 	RK_TRACE (EDITOR);
 
+	if (rownames) stopListenForObject (rownames);
 	if (dataframe) stopListenForObject (dataframe);
-	if (rownames) stopListenForObject (rownames);
 }
 
 bool RKVarEditDataFrameModel::insertColumns (int column, int count, const QModelIndex& parent) {
@@ -800,6 +801,8 @@
 
 	if (object == dataframe) {
 		while (!objects.isEmpty ()) RKVarEditModel::objectRemoved (objects[0]);
+		if (rownames) stopListenForObject (rownames);
+		rownames = 0;
 		stopListenForObject (dataframe);
 		dataframe = 0;
 	}


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