Index: trunk/ab5.0/abdev/BasicCompiler_Common/CDebugThreadInfo.cpp
===================================================================
--- trunk/ab5.0/abdev/BasicCompiler_Common/CDebugThreadInfo.cpp	(revision 739)
+++ trunk/ab5.0/abdev/BasicCompiler_Common/CDebugThreadInfo.cpp	(revision 740)
@@ -27,6 +27,6 @@
 
 	DWORD dwRWSectionPos;
-	dwRWSectionPos=pobj_DBDebugSection->ppobj_ds[0]->dwImageBase+
-						pobj_DBDebugSection->ppobj_ds[0]->dwRVA_RWSection;
+	dwRWSectionPos=pobj_DBDebugSection->debugSections[0]->dwImageBase+
+						pobj_DBDebugSection->debugSections[0]->dwRVA_RWSection;
 
 	ReadProcessMemory(hDebugProcess,
@@ -80,6 +80,6 @@
 	extern DWORD ImageBase;
 	if((HMODULE)(ULONG_PTR)ImageBase!=hTargetModule){
-		for(i=0;i<pobj_DBDebugSection->num;i++){
-			if((HMODULE)(ULONG_PTR)pobj_DBDebugSection->ppobj_ds[i]->dwImageBase==hTargetModule){
+		for(i=0;i<pobj_DBDebugSection->debugSections.size();i++){
+			if((HMODULE)(ULONG_PTR)pobj_DBDebugSection->debugSections[i]->dwImageBase==hTargetModule){
 				pobj_DBDebugSection->choice(i);
 				break;
Index: trunk/ab5.0/abdev/BasicCompiler_Common/Debug.cpp
===================================================================
--- trunk/ab5.0/abdev/BasicCompiler_Common/Debug.cpp	(revision 739)
+++ trunk/ab5.0/abdev/BasicCompiler_Common/Debug.cpp	(revision 740)
@@ -338,10 +338,11 @@
 }
 
-void Set_DebugSys_dwThreadID(){
-	int i;
-	for(i=0;i<pobj_DBDebugSection->num;i++){
+void Set_DebugSys_dwThreadID()
+{
+	BOOST_FOREACH( CDebugSection *pDebugSection, pobj_DBDebugSection->debugSections )
+	{
 		ULONG_PTR lpAccBytes;
 		WriteProcessMemory(hDebugProcess,
-			(void *)(ULONG_PTR)(pobj_DBDebugSection->ppobj_ds[i]->dwImageBase + pobj_DBDebugSection->ppobj_ds[i]->dwRVA_RWSection),
+			(void *)(ULONG_PTR)(pDebugSection->dwImageBase + pDebugSection->dwRVA_RWSection),
 			_DebugSys_dwThreadID,
 			sizeof(DWORD)*MAX_DEBUG_THREAD,
Index: trunk/ab5.0/abdev/BasicCompiler_Common/DebugMiddleFile.cpp
===================================================================
--- trunk/ab5.0/abdev/BasicCompiler_Common/DebugMiddleFile.cpp	(revision 739)
+++ trunk/ab5.0/abdev/BasicCompiler_Common/DebugMiddleFile.cpp	(revision 740)
@@ -437,14 +437,14 @@
 
 
-CDBDebugSection::CDBDebugSection(){
-	ppobj_ds=(CDebugSection **)HeapAlloc(hHeap,0,1);
-	num=0;
-}
-CDBDebugSection::~CDBDebugSection(){
-	int i;
-	for(i=0;i<num;i++){
-		delete ppobj_ds[i];
-	}
-	HeapDefaultFree(ppobj_ds);
+CDBDebugSection::CDBDebugSection()
+{
+}
+CDBDebugSection::~CDBDebugSection()
+{
+	BOOST_FOREACH( CDebugSection *pDebugSection, debugSections )
+	{
+		delete pDebugSection;
+	}
+	debugSections.clear();
 }
 
@@ -458,7 +458,5 @@
 	}
 
-	ppobj_ds=(CDebugSection **)HeapReAlloc(hHeap,0,ppobj_ds,(num+1)*sizeof(CDebugSection *));
-	ppobj_ds[num]=pobj_d;
-	num++;
+	debugSections.push_back( pobj_d );
 
 	return 1;
@@ -466,13 +464,10 @@
 
 void CDBDebugSection::del(HMODULE hModule){
-	int i;
-	for(i=0;i<num;i++){
-		if((HMODULE)(ULONG_PTR)ppobj_ds[i]->dwImageBase==hModule){
-			delete ppobj_ds[i];
-
-			num--;
-			for(;i<num;i++){
-				ppobj_ds[i]=ppobj_ds[i+1];
-			}
+	for( int i=0; i<static_cast<int>(this->debugSections.size()); i++ )
+	{
+		if( (HMODULE)(ULONG_PTR)this->debugSections[i]->dwImageBase == hModule )
+		{
+			delete debugSections[i];
+			Jenga::Common::EraseVectorItem<std::vector<CDebugSection *>>( debugSections, i );
 			break;
 		}
@@ -480,6 +475,7 @@
 }
 
-void CDBDebugSection::choice(int index){
-	pobj_now=ppobj_ds[index];
+void CDBDebugSection::choice( int index )
+{
+	pobj_now = debugSections[index];
 	pobj_now->choice();
 }
Index: trunk/ab5.0/abdev/BasicCompiler_Common/DebugSection.h
===================================================================
--- trunk/ab5.0/abdev/BasicCompiler_Common/DebugSection.h	(revision 739)
+++ trunk/ab5.0/abdev/BasicCompiler_Common/DebugSection.h	(revision 740)
@@ -81,6 +81,5 @@
 class CDBDebugSection{
 public:
-	CDebugSection **ppobj_ds;
-	int num;
+	std::vector<CDebugSection *> debugSections;
 
 	CDebugSection *pobj_now;
