[GME-commit] GMESRC/GME/Core CoreProject.cpp, 1.17, 1.18 CoreTerritory.cpp, 1.5, 1.6

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Sat Jun 16 17:47:43 CDT 2007


Update of /project/gme-repository/GMESRC/GME/Core
In directory escher:/tmp/cvs-serv17310

Modified Files:
	CoreProject.cpp CoreTerritory.cpp 
Log Message:
Core fix for GME-154.
http://escher.isis.vanderbilt.edu/JIRA/browse/GME-154

CoreProject and CoreTerritory both have had references to each other. This lead to problems upon Close and deallocation deadlock for Territories, and finally for CMgaProject.
Solution: Territories will have no more refcounted copy of CoreProject.
The dependency thus will be one way only.



CVS User: Zoltan Molnar, ISIS (zolmol)

Index: CoreTerritory.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Core/CoreTerritory.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** CoreTerritory.cpp	13 Oct 2004 15:17:54 -0000	1.5
--- CoreTerritory.cpp	16 Jun 2007 22:47:41 -0000	1.6
***************
*** 27,30 ****
--- 27,31 ----
  	territory->project = project;
  	project->RegisterTerritory(territory);
+ 	project->Release();// do not add ref to project to avoid cross reference // zolmol
  
  	return territory;
***************
*** 39,45 ****
  
  	project->UnregisterTerritory(this);
  
  #ifdef _DEBUG
! 	project = NULL;
  #endif
  }
--- 40,47 ----
  
  	project->UnregisterTerritory(this);
+ 	project.Detach(); // project member is not refcounted by us // zolmol
  
  #ifdef _DEBUG
! 	//project = NULL; // not needed, taken care of above in ::Create // zolmol
  #endif
  }

Index: CoreProject.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Core/CoreProject.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** CoreProject.cpp	7 Mar 2007 21:04:40 -0000	1.17
--- CoreProject.cpp	16 Jun 2007 22:47:41 -0000	1.18
***************
*** 26,29 ****
--- 26,33 ----
  	put_Storage(NULL);
  
+ 	object_lookup.clear();         // zolmol
+ 	pushed_territorys.clear();     // 
+ 	created_territorys.clear();    // end
+ 
  	ASSERT( transactions.empty() );
  	ASSERT( finaltr_items.empty() );
***************
*** 129,132 ****
--- 133,140 ----
  			metaproject = CastToMetaProject(p);
  		}
+ 		else // newly added
+ 		{
+ 			created_territorys.clear();
+ 		}
  	}
  	COMCATCH(;)
***************
*** 789,792 ****
--- 797,802 ----
  
  	created_territorys.push_front(territory);
+ 	ASSERT( find(created_territorys.begin(), created_territorys.end(), territory) !=
+ 		created_territorys.end() );
  }
  
***************
*** 802,805 ****
--- 812,817 ----
  
  	created_territorys.remove(territory);
+ 	ASSERT( find(created_territorys.begin(), created_territorys.end(), territory) ==
+ 		created_territorys.end() );
  }
  



More information about the GME-commit mailing list