[commit] r2435 - trunk/GME/Mga

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Tue Feb 18 16:29:23 CST 2014


Author: ksmyth
Date: Tue Feb 18 16:29:23 2014
New Revision: 2435

Log:
Fix bug where Addons would get notified for objects that were modified (by an addon during CommitTransaction) in the next CommitTransaction. (META-2850)

Modified:
   trunk/GME/Mga/MgaProject.cpp

Modified: trunk/GME/Mga/MgaProject.cpp
==============================================================================
--- trunk/GME/Mga/MgaProject.cpp	Tue Feb 18 16:29:11 2014	(r2434)
+++ trunk/GME/Mga/MgaProject.cpp	Tue Feb 18 16:29:23 2014	(r2435)
@@ -1341,6 +1341,15 @@
 STDMETHODIMP CMgaProject::BeginTransaction(IMgaTerritory *ter, transactiontype_enum mode)
 {
 	COMTRY {
+		ASSERT(temporalobjs.empty());
+		while (temporalobjs.size())
+			temporalobjs.pop();
+		ASSERT(changedobjs.empty());
+		while (changedobjs.size())
+			changedobjs.pop();
+		ASSERT(notifyobjs.empty());
+		while (notifyobjs.size())
+			notifyobjs.pop();
 		CComPtr<IMgaTerritory> ttemp;
 		if(baseterr)
 			COMTHROW(E_MGA_ALREADY_IN_TRANSACTION);
@@ -1411,6 +1420,8 @@
 //			self[ATTRID_MDATE] = Now();
 		}
 		HRESULT hr = CommitNotify();
+		while (temporalobjs.size()) // CommitNotify may make changes. Don't notify for them.
+			temporalobjs.pop();
 		if (FAILED(hr))
 			return hr;
 		COMTHROW(dataproject->PopTerritory());


More information about the gme-commit mailing list