Index: /Include/basic.sbp
===================================================================
--- /Include/basic.sbp	(revision 265)
+++ /Include/basic.sbp	(revision 266)
@@ -143,13 +143,9 @@
 		_System_hProcessHeap=HeapCreate(HEAP_GENERATE_EXCEPTIONS,0,0)
 
-		' GC管理オブジェクトを生成
-		_System_pGC = _System_calloc( SizeOf( _System_CGarbageCollection ) )
-		_System_pGC->Begin()
+		' GC管理オブジェクトを初期化
+		_System_CGarbageCollection.Initialize()
 
 		' 動的型情報を生成
 		_System_TypeBase.Initialize()
-
-		'Initialize global variables
-		_System_InitDllGlobalVariables()
 
 		'Initialize static variables
Index: /Include/system/gc.sbp
===================================================================
--- /Include/system/gc.sbp	(revision 265)
+++ /Include/system/gc.sbp	(revision 266)
@@ -26,4 +26,5 @@
 
 Class _System_CGarbageCollection
+
 	ppPtr As *VoidPtr
 	pSize As *SIZE_T
@@ -68,4 +69,20 @@
 
 Public
+
+	Static Sub Initialize()
+		Dim temporary[255] As Char
+		If GetEnvironmentVariable( "ActiveBasicGarbageCollection", temporary, 255 ) Then
+			' 既にGCがプロセスに存在するとき
+			sscanf( temporary, "%08x", VarPtr( _System_pGC ) )
+			MessageBox(0,temporary,"GetEnvironmentVariable",0)
+		Else
+			_System_pGC = _System_calloc( SizeOf( _System_CGarbageCollection ) )
+			_System_pGC->Begin()
+
+			' GCをプロセスに登録する
+			sprintf( temporary, "%08x", _System_pGC )
+			SetEnvironmentVariable( "ActiveBasicGarbageCollection", temporary )
+		End If
+	End Sub
 
 	Sub Begin()
