Changeset 146 for Include/basic.sbp


Ignore:
Timestamp:
Mar 11, 2007, 2:13:27 AM (17 years ago)
Author:
dai
Message:

プロセスの初期化と終了処理を修正。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Include/basic.sbp

    r142 r146  
    113113
    114114Sub _System_StartupProgram()
    115     'この関数はアプリケーションの起動時にシステムからコールバックされます
     115    'Unsafe
    116116
    117     InitializeCriticalSection(_System_CriticalSection)
     117        'この関数はアプリケーションの起動時にシステムからコールバックされます
    118118
    119     _System_hProcessHeap=HeapCreate(HEAP_GENERATE_EXCEPTIONS,0,0)
     119        InitializeCriticalSection(_System_CriticalSection)
    120120
    121     _System_GC._System_CGarbageCollection()
     121        _System_hProcessHeap=HeapCreate(HEAP_GENERATE_EXCEPTIONS,0,0)
    122122
    123     'Initialize global variables
    124     _System_InitDllGlobalVariables()
     123        ' GC管理オブジェクトを生成
     124        _System_pGC = _System_calloc( SizeOf( _System_CGarbageCollection ) )
     125        _System_pGC->Begin()
    125126
    126     'Initialize static variables
    127     _System_InitStaticLocalVariables()
     127        'Initialize global variables
     128        _System_InitDllGlobalVariables()
     129
     130        'Initialize static variables
     131        _System_InitStaticLocalVariables()
     132
     133        'TODO:
     134        ' Set current thread priority
     135        'Dim thread = Thread.CurrentThread()
     136        'thread.Priority = ThreadPriority.Normal
     137
     138    'End Unsafe
    128139End Sub
    129140
    130141Sub _System_EndProgram()
    131     DeleteCriticalSection(_System_CriticalSection)
     142    'Unsafe
     143
     144        _System_Call_Destructor_of_GlobalObject()
     145
     146        ' GC管理オブジェクトを破棄
     147        _System_pGC->Finish()
     148        _System_free( _System_pGC )
     149
     150        DeleteCriticalSection(_System_CriticalSection)
     151
     152        HeapDestroy( _System_hProcessHeap )
     153
     154    'End Unsafe
    132155End Sub
    133156
Note: See TracChangeset for help on using the changeset viewer.