[commit] r2553 - trunk/GME/Mga

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Wed Oct 15 12:24:48 CDT 2014


Author: ksmyth
Date: Wed Oct 15 12:24:48 2014
New Revision: 2553

Log:
Fix addon-related bugs: addon may modify FCO in non-nested transaction, so clear temporal mask. Addon may delete newly-created FCOs, so dont crash

Modified:
   trunk/GME/Mga/MgaFCO.cpp

Modified: trunk/GME/Mga/MgaFCO.cpp
==============================================================================
--- trunk/GME/Mga/MgaFCO.cpp	Wed Oct 15 12:24:44 2014	(r2552)
+++ trunk/GME/Mga/MgaFCO.cpp	Wed Oct 15 12:24:48 2014	(r2553)
@@ -926,8 +926,8 @@
 
 HRESULT FCO::objrwnotify() {
 	COMTRY {
-			unsigned long chmask = changemask;
-			changemask = 0;
+			unsigned long chmask = this->changemask;
+			this->changemask = 0;
 			// No other notification on deleted objects
 			if(chmask & OBJEVENT_DESTROYED) chmask = OBJEVENT_DESTROYED;
 			CMgaProject::addoncoll::iterator ai, abeg = mgaproject->alladdons.begin(), aend = mgaproject->alladdons.end();
@@ -973,7 +973,8 @@
 			if(chmask & OBJEVENT_CREATED) {
 				// send message to all territories that contain parent, 
 				CoreObj parent = self[ATTRID_PARENT];
-				if(parent.IsContainer()) {
+				// n.b. parent may be null if an addon deleted self and parent
+				if (parent && parent.IsContainer()) {
 					auto objforcore = ObjForCore(parent);
 					FCO &p = *objforcore;
 					
@@ -1016,6 +1017,7 @@
 					COMTHROW(mgaproject->popterr());  // this may release the territory!!!
 				}
 			}
+			this->temporalmask = 0; // may have been changed during notification (but we won't notify about it)
 	} COMCATCH(;)
 }
 


More information about the gme-commit mailing list