• R/O
  • SSH
  • HTTPS

iris-fmw: Commit


Commit MetaInfo

Revision266 (tree)
Time2012-01-20 23:31:00
Authorshirayanagi

Log Message

angelscript 着手

Change Summary

Incremental Difference

--- trunk/framework/sample/Windows/unittest/src/nacl_test/file/index.html (revision 265)
+++ trunk/framework/sample/Windows/unittest/src/nacl_test/file/index.html (revision 266)
@@ -121,7 +121,7 @@
121121 <embed name="nacl_module"
122122 id="file"
123123 width="0" height="0"
124- src="file.nmf"
124+ src="file_test.nmf"
125125 type="application/x-nacl"
126126 style="background-color:gray" />
127127 </div>
--- trunk/framework/src/iris_config.h (revision 265)
+++ trunk/framework/src/iris_config.h (revision 266)
@@ -136,6 +136,11 @@
136136 # else
137137 # define IRIS_LIB_AMD64
138138 # endif
139+# if defined(_WIN64)
140+# define IRIS_LIB_X64 "_x64"
141+# else
142+# define IRIS_LIB_X64
143+# endif
139144 #endif
140145
141146 #if defined(_DEBUG)
--- trunk/framework/src/platform/windows/win/os/WXCriticalSection.cpp (revision 265)
+++ trunk/framework/src/platform/windows/win/os/WXCriticalSection.cpp (revision 266)
@@ -8,7 +8,7 @@
88 * @version 1.0
99 *
1010 * @par copyright
11- * Copyright (C) 2010-2011 Takazumi Shirayanagi\n
11+ * Copyright (C) 2010-2012 Takazumi Shirayanagi\n
1212 * The new BSD License is applied to this software.
1313 * see iris_LICENSE.txt
1414 */
--- trunk/framework/src/platform/windows/win/os/WXCriticalSection.h (revision 265)
+++ trunk/framework/src/platform/windows/win/os/WXCriticalSection.h (revision 266)
@@ -8,7 +8,7 @@
88 * @version 1.0
99 *
1010 * @par copyright
11- * Copyright (C) 2010-2011 Takazumi Shirayanagi\n
11+ * Copyright (C) 2010-2012 Takazumi Shirayanagi\n
1212 * The new BSD License is applied to this software.
1313 * see iris_LICENSE.txt
1414 */
@@ -41,6 +41,7 @@
4141 public:
4242 /// ロック取得
4343 virtual bool Lock(void);
44+ virtual bool Lock(u32 /*uTimeout*/) { return Lock(); }
4445 /// ロック解除
4546 virtual void Unlock(void);
4647 /// ロック取得
--- trunk/framework/src/platform/windows/win/os/WXSyncObject.h (revision 265)
+++ trunk/framework/src/platform/windows/win/os/WXSyncObject.h (revision 266)
@@ -8,7 +8,7 @@
88 * @version 1.0
99 *
1010 * @par copyright
11- * Copyright (C) 2009-2011 Takazumi Shirayanagi\n
11+ * Copyright (C) 2009-2012 Takazumi Shirayanagi\n
1212 * The new BSD License is applied to this software.
1313 * see iris_LICENSE.txt
1414 */
@@ -49,17 +49,6 @@
4949 return Wait(INFINITE);
5050 }
5151 public:
52- /**
53- * @brief ロックする
54- */
55- virtual BOOL Lock(DWORD dwTimeout)
56- {
57- DWORD dwRet = ::WaitForSingleObject( m_hObject, dwTimeout );
58- if( dwRet == WAIT_OBJECT_0 || dwRet == WAIT_ABANDONED )
59- return TRUE;
60- return FALSE;
61- }
62-
6352 // アンロックする
6453 virtual BOOL Unlock(LONG lCount, LONG *pPrevCount = nullptr)
6554 {
@@ -74,6 +63,13 @@
7463 {
7564 return Lock(INFINITE) != 0;
7665 }
66+ virtual bool Lock(u32 uTimeout)
67+ {
68+ DWORD dwRet = ::WaitForSingleObject( m_hObject, uTimeout );
69+ if( dwRet == WAIT_OBJECT_0 || dwRet == WAIT_ABANDONED )
70+ return true;
71+ return false;
72+ }
7773 /// ロック解除
7874 virtual void Unlock(void)
7975 {
--- trunk/framework/src/platform/windows/win/debug/dbghelp/WXImageDirectoryEntry.h (revision 265)
+++ trunk/framework/src/platform/windows/win/debug/dbghelp/WXImageDirectoryEntry.h (revision 266)
@@ -177,11 +177,11 @@
177177 }
178178 };
179179 public:
180- static PROC* Find(_Myt& pidesc, PROC pfnTarget, HMODULE hModule)
180+ static inline PROC* Find(_Myt& pidesc, PROC pfnTarget, HMODULE hModule)
181181 {
182182 return impl<value_type, void>::Find(pidesc, pfnTarget, hModule);
183183 }
184- static PROC* Find(PROC pfnTarget, HMODULE hModule, BOOLEAN bMappedAsImage)
184+ static inline PROC* Find(PROC pfnTarget, HMODULE hModule, BOOLEAN bMappedAsImage)
185185 {
186186 _Myt pidesc((PVOID)hModule, bMappedAsImage);
187187 return Find(pidesc, pfnTarget, hModule);
--- trunk/framework/src/platform/windows/win/debug/dbghelp/WXObjLeakCheck.cpp (revision 265)
+++ trunk/framework/src/platform/windows/win/debug/dbghelp/WXObjLeakCheck.cpp (revision 266)
@@ -19,6 +19,7 @@
1919 //======================================================================
2020 // include
2121 #include "WXObjLeakCheck.h"
22+#include "WXProcHook.h"
2223
2324 #ifdef _IRIS_DEBUG
2425 #include "WXDebugHelp.h"
@@ -43,7 +44,7 @@
4344
4445 //======================================================================
4546 // struct
46-typedef struct _tagObjectList
47+typedef struct tagObjectList
4748 {
4849 void* object;
4950 PROC close;
@@ -51,7 +52,7 @@
5152 TCHAR symbol[MAX_PATH];
5253 DWORD line;
5354 int count;
54- _tagObjectList* next;
55+ tagObjectList* next;
5556 } ObjectList;
5657
5758 //======================================================================
@@ -90,12 +91,11 @@
9091 // 実装クラス
9192 class CObjLeakCheckImpl : public IIrisObject
9293 {
93- typedef fnd::CScopedLock<CCriticalSection> CCSScopedLock;
94- enum
95- {
96- LIST_CAPACITY = 256,
97- };
94+ typedef fnd::CSingleLock<CCriticalSection> CCSScopedLock;
9895
96+ static const int LIST_CAPACITY = 256;
97+
98+#if !USE_RTL
9999 // CObjLeakCheck 用 StackTrace
100100 class CObjLeakCheckStackTrace : public CStackTrace
101101 {
@@ -128,6 +128,7 @@
128128 }
129129 #endif
130130 };
131+#endif
131132
132133 protected:
133134 HANDLE m_Heap;
@@ -227,7 +228,7 @@
227228 #if USE_RTL // use RunTime Library
228229 {
229230 const int kBackTraceCount = 10;
230- CRTLBackTrace<kBackTraceCount> backtrace;
231+ CRtlBackTrace<kBackTraceCount> backtrace;
231232 bool find = false;
232233 for( WORD i=0; i < backtrace.GetCount(); ++i )
233234 {
@@ -258,9 +259,8 @@
258259 }
259260 p->file[0] = '\0';
260261 p->line = 0;
262+ }
261263 find:
262- (void)0;
263- }
264264 #else
265265 {
266266 bool origin = HOOK_VARIABLE_NAME(CreateThread).IsOrigin();
@@ -534,7 +534,7 @@
534534 BOOL ret = ((PFN_CloseHandle)GET_ORIGIN_FUNC(CloseHandle))(hObject);
535535 if( ret )
536536 {
537- CObjLeakCheckImpl::GetInstance().Remove(hObject, GET_ORIGIN_FUNC(CloseHandle));
537+ GetInstance().Remove(hObject, GET_ORIGIN_FUNC(CloseHandle));
538538 }
539539 return ret;
540540 }
@@ -545,7 +545,7 @@
545545 HANDLE hdle = ((PFN_OpenEventA)GET_ORIGIN_FUNC(OpenEventA))(dwDesiredAccess, bInheritHandle, lpName);
546546 if( hdle != nullptr && hdle != INVALID_HANDLE_VALUE )
547547 {
548- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
548+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
549549 }
550550 return hdle;
551551 }
@@ -554,7 +554,7 @@
554554 HANDLE hdle = ((PFN_OpenEventW)GET_ORIGIN_FUNC(OpenEventW))(dwDesiredAccess, bInheritHandle, lpName);
555555 if( hdle != nullptr && hdle != INVALID_HANDLE_VALUE )
556556 {
557- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
557+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
558558 }
559559 return hdle;
560560 }
@@ -565,7 +565,7 @@
565565 HANDLE hdle = ((PFN_CreateEventA)GET_ORIGIN_FUNC(CreateEventA))(lpEventAttributes, bManualReset, bInitialState, lpName);
566566 if( hdle != nullptr && hdle != INVALID_HANDLE_VALUE )
567567 {
568- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
568+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
569569 }
570570 return hdle;
571571 }
@@ -574,7 +574,7 @@
574574 HANDLE hdle = ((PFN_CreateEventW)GET_ORIGIN_FUNC(CreateEventW))(lpEventAttributes, bManualReset, bInitialState, lpName);
575575 if( hdle != nullptr && hdle != INVALID_HANDLE_VALUE )
576576 {
577- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
577+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
578578 }
579579 return hdle;
580580 }
@@ -590,9 +590,9 @@
590590 if( ret && lpProcessInformation != nullptr )
591591 {
592592 if( lpProcessInformation->hProcess != nullptr )
593- CObjLeakCheckImpl::GetInstance().Add(lpProcessInformation->hProcess, GET_ORIGIN_FUNC(CloseHandle));
593+ GetInstance().Add(lpProcessInformation->hProcess, GET_ORIGIN_FUNC(CloseHandle));
594594 if( lpProcessInformation->hThread != nullptr )
595- CObjLeakCheckImpl::GetInstance().Add(lpProcessInformation->hThread, GET_ORIGIN_FUNC(CloseHandle));
595+ GetInstance().Add(lpProcessInformation->hThread, GET_ORIGIN_FUNC(CloseHandle));
596596 }
597597 return ret;
598598 }
@@ -607,9 +607,9 @@
607607 if( ret && lpProcessInformation != nullptr )
608608 {
609609 if( lpProcessInformation->hProcess != nullptr )
610- CObjLeakCheckImpl::GetInstance().Add(lpProcessInformation->hProcess, GET_ORIGIN_FUNC(CloseHandle));
610+ GetInstance().Add(lpProcessInformation->hProcess, GET_ORIGIN_FUNC(CloseHandle));
611611 if( lpProcessInformation->hThread != nullptr )
612- CObjLeakCheckImpl::GetInstance().Add(lpProcessInformation->hThread, GET_ORIGIN_FUNC(CloseHandle));
612+ GetInstance().Add(lpProcessInformation->hThread, GET_ORIGIN_FUNC(CloseHandle));
613613 }
614614 return ret;
615615 }
@@ -622,7 +622,7 @@
622622 , dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
623623 if( hdle != nullptr && hdle != INVALID_HANDLE_VALUE )
624624 {
625- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
625+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
626626 }
627627 return hdle;
628628 }
@@ -633,7 +633,7 @@
633633 , dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
634634 if( hdle != nullptr && hdle != INVALID_HANDLE_VALUE )
635635 {
636- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
636+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
637637 }
638638 return hdle;
639639 }
@@ -646,7 +646,7 @@
646646 , dwMaximumSizeHigh, dwMaximumSizeLow, lpName);
647647 if( hdle != nullptr && hdle != INVALID_HANDLE_VALUE )
648648 {
649- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
649+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
650650 }
651651 return hdle;
652652 }
@@ -657,7 +657,7 @@
657657 , dwMaximumSizeHigh, dwMaximumSizeLow, lpName);
658658 if( hdle != nullptr && hdle != INVALID_HANDLE_VALUE )
659659 {
660- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
660+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
661661 }
662662 return hdle;
663663 }
@@ -668,7 +668,7 @@
668668 HANDLE hdle = ((PFN_OpenFileMappingA)GET_ORIGIN_FUNC(OpenFileMappingA))(dwDesiredAccess, bInheritHandle, lpName);
669669 if( hdle != nullptr && hdle != INVALID_HANDLE_VALUE )
670670 {
671- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
671+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
672672 }
673673 return hdle;
674674 }
@@ -677,7 +677,7 @@
677677 HANDLE hdle = ((PFN_OpenFileMappingW)GET_ORIGIN_FUNC(OpenFileMappingW))(dwDesiredAccess, bInheritHandle, lpName);
678678 if( hdle != nullptr && hdle != INVALID_HANDLE_VALUE )
679679 {
680- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
680+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
681681 }
682682 return hdle;
683683 }
@@ -690,7 +690,7 @@
690690 , lpParameter, dwCreationFlags, lpThreadId);
691691 if( hdle != nullptr && hdle != INVALID_HANDLE_VALUE )
692692 {
693- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
693+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
694694 }
695695 return hdle;
696696 }
@@ -701,7 +701,7 @@
701701 HANDLE hdle = ((PFN_CreateMutexA)GET_ORIGIN_FUNC(CreateMutexA))(lpMutexAttributes, bInitialOwner, lpName);
702702 if( hdle != nullptr && hdle != INVALID_HANDLE_VALUE )
703703 {
704- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
704+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
705705 }
706706 return hdle;
707707 }
@@ -710,7 +710,7 @@
710710 HANDLE hdle = ((PFN_CreateMutexW)GET_ORIGIN_FUNC(CreateMutexW))(lpMutexAttributes, bInitialOwner, lpName);
711711 if( hdle != nullptr && hdle != INVALID_HANDLE_VALUE )
712712 {
713- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
713+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
714714 }
715715 return hdle;
716716 }
@@ -721,7 +721,7 @@
721721 HANDLE hdle = ((PFN_OpenMutexA)GET_ORIGIN_FUNC(OpenMutexA))(dwDesiredAccess, bInheritHandle, lpName);
722722 if( hdle != nullptr && hdle != INVALID_HANDLE_VALUE )
723723 {
724- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
724+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
725725 }
726726 return hdle;
727727 }
@@ -730,7 +730,7 @@
730730 HANDLE hdle = ((PFN_OpenMutexW)GET_ORIGIN_FUNC(OpenMutexW))(dwDesiredAccess, bInheritHandle, lpName);
731731 if( hdle != nullptr && hdle != INVALID_HANDLE_VALUE )
732732 {
733- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
733+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
734734 }
735735 return hdle;
736736 }
@@ -741,7 +741,7 @@
741741 HANDLE hdle = ((PFN_CreateSemaphoreA)GET_ORIGIN_FUNC(CreateSemaphoreA))(lpSemaphoreAttributes, lInitialCount, lMaximumCount, lpName);
742742 if( hdle != nullptr && hdle != INVALID_HANDLE_VALUE )
743743 {
744- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
744+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
745745 }
746746 return hdle;
747747 }
@@ -750,7 +750,7 @@
750750 HANDLE hdle = ((PFN_CreateSemaphoreW)GET_ORIGIN_FUNC(CreateSemaphoreW))(lpSemaphoreAttributes, lInitialCount, lMaximumCount, lpName);
751751 if( hdle != nullptr && hdle != INVALID_HANDLE_VALUE )
752752 {
753- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
753+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
754754 }
755755 return hdle;
756756 }
@@ -761,7 +761,7 @@
761761 HANDLE hdle = ((PFN_OpenSemaphoreA)GET_ORIGIN_FUNC(OpenSemaphoreA))(dwDesiredAccess, bInheritHandle, lpName);
762762 if( hdle != nullptr && hdle != INVALID_HANDLE_VALUE )
763763 {
764- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
764+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
765765 }
766766 return hdle;
767767 }
@@ -770,7 +770,7 @@
770770 HANDLE hdle = ((PFN_OpenSemaphoreW)GET_ORIGIN_FUNC(OpenSemaphoreW))(dwDesiredAccess, bInheritHandle, lpName);
771771 if( hdle != nullptr && hdle != INVALID_HANDLE_VALUE )
772772 {
773- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
773+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
774774 }
775775 return hdle;
776776 }
@@ -783,7 +783,7 @@
783783 , nOutBufferSize, nInBufferSize, nDefaultTimeOut, lpSecurityAttributes);
784784 if( hdle != nullptr && hdle != INVALID_HANDLE_VALUE )
785785 {
786- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
786+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
787787 }
788788 return hdle;
789789 }
@@ -794,7 +794,7 @@
794794 , nOutBufferSize, nInBufferSize, nDefaultTimeOut, lpSecurityAttributes);
795795 if( hdle != nullptr && hdle != INVALID_HANDLE_VALUE )
796796 {
797- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
797+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(CloseHandle));
798798 }
799799 return hdle;
800800 }
@@ -806,9 +806,9 @@
806806 if( ret )
807807 {
808808 if( hReadPipe != nullptr )
809- CObjLeakCheckImpl::GetInstance().Add(*hReadPipe, GET_ORIGIN_FUNC(CloseHandle));
809+ GetInstance().Add(*hReadPipe, GET_ORIGIN_FUNC(CloseHandle));
810810 if( hWritePipe != nullptr )
811- CObjLeakCheckImpl::GetInstance().Add(*hWritePipe, GET_ORIGIN_FUNC(CloseHandle));
811+ GetInstance().Add(*hWritePipe, GET_ORIGIN_FUNC(CloseHandle));
812812 }
813813 return ret;
814814 }
@@ -820,7 +820,7 @@
820820 BOOL ret = ((PFN_FindClose)GET_ORIGIN_FUNC(FindClose))(hFindFile);
821821 if( ret )
822822 {
823- CObjLeakCheckImpl::GetInstance().Remove(hFindFile, GET_ORIGIN_FUNC(FindClose));
823+ GetInstance().Remove(hFindFile, GET_ORIGIN_FUNC(FindClose));
824824 }
825825 return ret;
826826 }
@@ -830,7 +830,7 @@
830830 HANDLE hdle = ((PFN_FindFirstFileA)GET_ORIGIN_FUNC(FindFirstFileA))(lpFileName, lpFindFileData);
831831 if( hdle != nullptr && hdle != INVALID_HANDLE_VALUE )
832832 {
833- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(FindClose));
833+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(FindClose));
834834 }
835835 return hdle;
836836 }
@@ -839,7 +839,7 @@
839839 HANDLE hdle = ((PFN_FindFirstFileW)GET_ORIGIN_FUNC(FindFirstFileW))(lpFileName, lpFindFileData);
840840 if( hdle != nullptr && hdle != INVALID_HANDLE_VALUE )
841841 {
842- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(FindClose));
842+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(FindClose));
843843 }
844844 return hdle;
845845 }
@@ -850,7 +850,7 @@
850850 LSTATUS ret = ((PFN_RegCloseKey)GET_ORIGIN_FUNC(RegCloseKey))(hKey);
851851 if( ret == ERROR_SUCCESS )
852852 {
853- CObjLeakCheckImpl::GetInstance().Remove(hKey, GET_ORIGIN_FUNC(RegCloseKey));
853+ GetInstance().Remove(hKey, GET_ORIGIN_FUNC(RegCloseKey));
854854 }
855855 return ret;
856856 }
@@ -860,7 +860,7 @@
860860 LSTATUS ret = ((PFN_RegOpenKeyExA)GET_ORIGIN_FUNC(RegOpenKeyExA))(hKey, lpSubKey, ulOptions, samDesired, phkResult);
861861 if( ret == ERROR_SUCCESS && phkResult != nullptr )
862862 {
863- CObjLeakCheckImpl::GetInstance().Add(*phkResult, GET_ORIGIN_FUNC(RegCloseKey));
863+ GetInstance().Add(*phkResult, GET_ORIGIN_FUNC(RegCloseKey));
864864 }
865865 return ret;
866866 }
@@ -869,7 +869,7 @@
869869 LSTATUS ret = ((PFN_RegOpenKeyExW)GET_ORIGIN_FUNC(RegOpenKeyExW))(hKey, lpSubKey, ulOptions, samDesired, phkResult);
870870 if( ret == ERROR_SUCCESS && phkResult != nullptr )
871871 {
872- CObjLeakCheckImpl::GetInstance().Add(*phkResult, GET_ORIGIN_FUNC(RegCloseKey));
872+ GetInstance().Add(*phkResult, GET_ORIGIN_FUNC(RegCloseKey));
873873 }
874874 return ret;
875875 }
@@ -880,7 +880,7 @@
880880 LSTATUS ret = ((PFN_RegOpenKeyA)GET_ORIGIN_FUNC(RegOpenKeyA))(hKey, lpSubKey, phkResult);
881881 if( ret == ERROR_SUCCESS && phkResult != nullptr )
882882 {
883- CObjLeakCheckImpl::GetInstance().Add(*phkResult, GET_ORIGIN_FUNC(RegCloseKey));
883+ GetInstance().Add(*phkResult, GET_ORIGIN_FUNC(RegCloseKey));
884884 }
885885 return ret;
886886 }
@@ -889,7 +889,7 @@
889889 LSTATUS ret = ((PFN_RegOpenKeyW)GET_ORIGIN_FUNC(RegOpenKeyW))(hKey, lpSubKey, phkResult);
890890 if( ret == ERROR_SUCCESS && phkResult != nullptr )
891891 {
892- CObjLeakCheckImpl::GetInstance().Add(*phkResult, GET_ORIGIN_FUNC(RegCloseKey));
892+ GetInstance().Add(*phkResult, GET_ORIGIN_FUNC(RegCloseKey));
893893 }
894894 return ret;
895895 }
@@ -902,7 +902,7 @@
902902 , dwOptions, samDesired, lpSecurityAttributes, phkResult, lpdwDisposition);
903903 if( ret == ERROR_SUCCESS && phkResult != nullptr )
904904 {
905- CObjLeakCheckImpl::GetInstance().Add(*phkResult, GET_ORIGIN_FUNC(RegCloseKey));
905+ GetInstance().Add(*phkResult, GET_ORIGIN_FUNC(RegCloseKey));
906906 }
907907 return ret;
908908 }
@@ -913,7 +913,7 @@
913913 , dwOptions, samDesired, lpSecurityAttributes, phkResult, lpdwDisposition);
914914 if( ret == ERROR_SUCCESS && phkResult != nullptr )
915915 {
916- CObjLeakCheckImpl::GetInstance().Add(*phkResult, GET_ORIGIN_FUNC(RegCloseKey));
916+ GetInstance().Add(*phkResult, GET_ORIGIN_FUNC(RegCloseKey));
917917 }
918918 return ret;
919919 }
@@ -924,7 +924,7 @@
924924 LSTATUS ret = ((PFN_RegCreateKeyA)GET_ORIGIN_FUNC(RegCreateKeyA))(hKey, lpSubKey, phkResult);
925925 if( ret == ERROR_SUCCESS && phkResult != nullptr )
926926 {
927- CObjLeakCheckImpl::GetInstance().Add(*phkResult, GET_ORIGIN_FUNC(RegCloseKey));
927+ GetInstance().Add(*phkResult, GET_ORIGIN_FUNC(RegCloseKey));
928928 }
929929 return ret;
930930 }
@@ -933,7 +933,7 @@
933933 LSTATUS ret = ((PFN_RegCreateKeyW)GET_ORIGIN_FUNC(RegCreateKeyW))(hKey, lpSubKey, phkResult);
934934 if( ret == ERROR_SUCCESS && phkResult != nullptr )
935935 {
936- CObjLeakCheckImpl::GetInstance().Add(*phkResult, GET_ORIGIN_FUNC(RegCloseKey));
936+ GetInstance().Add(*phkResult, GET_ORIGIN_FUNC(RegCloseKey));
937937 }
938938 return ret;
939939 }
@@ -944,7 +944,7 @@
944944 LSTATUS ret = ((PFN_RegConnectRegistryA)GET_ORIGIN_FUNC(RegConnectRegistryA))(lpMachineName, hKey, phkResult);
945945 if( ret == ERROR_SUCCESS && phkResult != nullptr )
946946 {
947- CObjLeakCheckImpl::GetInstance().Add(*phkResult, GET_ORIGIN_FUNC(RegCloseKey));
947+ GetInstance().Add(*phkResult, GET_ORIGIN_FUNC(RegCloseKey));
948948 }
949949 return ret;
950950 }
@@ -953,7 +953,7 @@
953953 LSTATUS ret = ((PFN_RegConnectRegistryW)GET_ORIGIN_FUNC(RegConnectRegistryW))(lpMachineName, hKey, phkResult);
954954 if( ret == ERROR_SUCCESS && phkResult != nullptr )
955955 {
956- CObjLeakCheckImpl::GetInstance().Add(*phkResult, GET_ORIGIN_FUNC(RegCloseKey));
956+ GetInstance().Add(*phkResult, GET_ORIGIN_FUNC(RegCloseKey));
957957 }
958958 return ret;
959959 }
@@ -964,7 +964,7 @@
964964 BOOL ret = ((PFN_DeleteObject)GET_ORIGIN_FUNC(DeleteObject))(hObject);
965965 if( ret )
966966 {
967- CObjLeakCheckImpl::GetInstance().Remove(hObject, GET_ORIGIN_FUNC(DeleteObject));
967+ GetInstance().Remove(hObject, GET_ORIGIN_FUNC(DeleteObject));
968968 }
969969 return ret;
970970 }
@@ -973,7 +973,7 @@
973973 HPEN hdle = ((PFN_CreatePen)GET_ORIGIN_FUNC(CreatePen))(iStyle, cWidth, color);
974974 if( hdle != nullptr )
975975 {
976- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
976+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
977977 }
978978 return hdle;
979979 }
@@ -982,7 +982,7 @@
982982 HPEN hdle = ((PFN_CreatePenIndirect)GET_ORIGIN_FUNC(CreatePenIndirect))(plpen);
983983 if( hdle != nullptr )
984984 {
985- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
985+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
986986 }
987987 return hdle;
988988 }
@@ -991,7 +991,7 @@
991991 HPEN hdle = ((PFN_ExtCreatePen)GET_ORIGIN_FUNC(ExtCreatePen))(iPenStyle, cWidth, plbrush, cStyle, pstyle);
992992 if( hdle != nullptr )
993993 {
994- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
994+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
995995 }
996996 return hdle;
997997 }
@@ -1001,7 +1001,7 @@
10011001 HBRUSH hdle = ((PFN_CreateBrushIndirect)GET_ORIGIN_FUNC(CreateBrushIndirect))(plbrush);
10021002 if( hdle != nullptr )
10031003 {
1004- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
1004+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
10051005 }
10061006 return hdle;
10071007 }
@@ -1010,7 +1010,7 @@
10101010 HBRUSH hdle = ((PFN_CreateDIBPatternBrush)GET_ORIGIN_FUNC(CreateDIBPatternBrush))(h, iUsage);
10111011 if( hdle != nullptr )
10121012 {
1013- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
1013+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
10141014 }
10151015 return hdle;
10161016 }
@@ -1019,7 +1019,7 @@
10191019 HBRUSH hdle = ((PFN_CreateDIBPatternBrushPt)GET_ORIGIN_FUNC(CreateDIBPatternBrushPt))(lpPackedDIB, iUsage);
10201020 if( hdle != nullptr )
10211021 {
1022- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
1022+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
10231023 }
10241024 return hdle;
10251025 }
@@ -1028,7 +1028,7 @@
10281028 HBRUSH hdle = ((PFN_CreateHatchBrush)GET_ORIGIN_FUNC(CreateHatchBrush))(iHatch, color);
10291029 if( hdle != nullptr )
10301030 {
1031- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
1031+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
10321032 }
10331033 return hdle;
10341034 }
@@ -1037,7 +1037,7 @@
10371037 HBRUSH hdle = ((PFN_CreatePatternBrush)GET_ORIGIN_FUNC(CreatePatternBrush))(hbm);
10381038 if( hdle != nullptr )
10391039 {
1040- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
1040+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
10411041 }
10421042 return hdle;
10431043 }
@@ -1046,7 +1046,7 @@
10461046 HBRUSH hdle = ((PFN_CreateSolidBrush)GET_ORIGIN_FUNC(CreateSolidBrush))(color);
10471047 if( hdle != nullptr )
10481048 {
1049- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
1049+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
10501050 }
10511051 return hdle;
10521052 }
@@ -1059,7 +1059,7 @@
10591059 , bUnderline, bStrikeOut, iCharSet, iOutPrecision, iClipPrecision, iQuality, iPitchAndFamily, pszFaceName);
10601060 if( hdle != nullptr )
10611061 {
1062- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
1062+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
10631063 }
10641064 return hdle;
10651065 }
@@ -1071,7 +1071,7 @@
10711071 , bUnderline, bStrikeOut, iCharSet, iOutPrecision, iClipPrecision, iQuality, iPitchAndFamily, pszFaceName);
10721072 if( hdle != nullptr )
10731073 {
1074- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
1074+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
10751075 }
10761076 return hdle;
10771077 }
@@ -1080,7 +1080,7 @@
10801080 HFONT hdle = ((PFN_CreateFontIndirectA)GET_ORIGIN_FUNC(CreateFontIndirectA))(lplf);
10811081 if( hdle != nullptr )
10821082 {
1083- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
1083+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
10841084 }
10851085 return hdle;
10861086 }
@@ -1089,7 +1089,7 @@
10891089 HFONT hdle = ((PFN_CreateFontIndirectW)GET_ORIGIN_FUNC(CreateFontIndirectW))(lplf);
10901090 if( hdle != nullptr )
10911091 {
1092- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
1092+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
10931093 }
10941094 return hdle;
10951095 }
@@ -1099,7 +1099,7 @@
10991099 HBITMAP hdle = ((PFN_CreateBitmap)GET_ORIGIN_FUNC(CreateBitmap))(nWidth, nHeight, nPlanes, nBitCount, lpBits);
11001100 if( hdle != nullptr )
11011101 {
1102- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
1102+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
11031103 }
11041104 return hdle;
11051105 }
@@ -1108,7 +1108,7 @@
11081108 HBITMAP hdle = ((PFN_CreateBitmapIndirect)GET_ORIGIN_FUNC(CreateBitmapIndirect))(pbm);
11091109 if( hdle != nullptr )
11101110 {
1111- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
1111+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
11121112 }
11131113 return hdle;
11141114 }
@@ -1117,7 +1117,7 @@
11171117 HBITMAP hdle = ((PFN_CreateCompatibleBitmap)GET_ORIGIN_FUNC(CreateCompatibleBitmap))(hdc, cx, cy);
11181118 if( hdle != nullptr )
11191119 {
1120- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
1120+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
11211121 }
11221122 return hdle;
11231123 }
@@ -1126,7 +1126,7 @@
11261126 HBITMAP hdle = ((PFN_CreateDiscardableBitmap)GET_ORIGIN_FUNC(CreateDiscardableBitmap))(hdc, cx, cy);
11271127 if( hdle != nullptr )
11281128 {
1129- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
1129+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
11301130 }
11311131 return hdle;
11321132 }
@@ -1135,7 +1135,7 @@
11351135 HBITMAP hdle = ((PFN_CreateDIBitmap)GET_ORIGIN_FUNC(CreateDIBitmap))(hdc, pbmih, flInit, pjBits, pbmi, iUsage);
11361136 if( hdle != nullptr )
11371137 {
1138- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
1138+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
11391139 }
11401140 return hdle;
11411141 }
@@ -1144,7 +1144,7 @@
11441144 HBITMAP hdle = ((PFN_CreateDIBSection)GET_ORIGIN_FUNC(CreateDIBSection))(hdc, lpbmi, usage, ppvBits, hSection, offset);
11451145 if( hdle != nullptr )
11461146 {
1147- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
1147+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
11481148 }
11491149 return hdle;
11501150 }
@@ -1156,7 +1156,7 @@
11561156 HRGN hdle = ((PFN_CreateEllipticRgn)GET_ORIGIN_FUNC(CreateEllipticRgn))(x1, y1, x2, y2);
11571157 if( hdle != nullptr )
11581158 {
1159- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
1159+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
11601160 }
11611161 return hdle;
11621162 }
@@ -1165,7 +1165,7 @@
11651165 HRGN hdle = ((PFN_CreateEllipticRgnIndirect)GET_ORIGIN_FUNC(CreateEllipticRgnIndirect))(lprect);
11661166 if( hdle != nullptr )
11671167 {
1168- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
1168+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
11691169 }
11701170 return hdle;
11711171 }
@@ -1174,7 +1174,7 @@
11741174 HRGN hdle = ((PFN_CreatePolyPolygonRgn)GET_ORIGIN_FUNC(CreatePolyPolygonRgn))(pptl, pc, cPoly, iMode);
11751175 if( hdle != nullptr )
11761176 {
1177- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
1177+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
11781178 }
11791179 return hdle;
11801180 }
@@ -1183,7 +1183,7 @@
11831183 HRGN hdle = ((PFN_CreatePolygonRgn)GET_ORIGIN_FUNC(CreatePolygonRgn))(pptl, cPoly, iMode);
11841184 if( hdle != nullptr )
11851185 {
1186- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
1186+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
11871187 }
11881188 return hdle;
11891189 }
@@ -1192,7 +1192,7 @@
11921192 HRGN hdle = ((PFN_CreateRectRgn)GET_ORIGIN_FUNC(CreateRectRgn))(x1, y1, x2, y2);
11931193 if( hdle != nullptr )
11941194 {
1195- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
1195+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
11961196 }
11971197 return hdle;
11981198 }
@@ -1201,7 +1201,7 @@
12011201 HRGN hdle = ((PFN_CreateRectRgnIndirect)GET_ORIGIN_FUNC(CreateRectRgnIndirect))(lprect);
12021202 if( hdle != nullptr )
12031203 {
1204- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
1204+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
12051205 }
12061206 return hdle;
12071207 }
@@ -1210,7 +1210,7 @@
12101210 HRGN hdle = ((PFN_CreateRoundRectRgn)GET_ORIGIN_FUNC(CreateRoundRectRgn))(x1, y1, x2, y2, w, h);
12111211 if( hdle != nullptr )
12121212 {
1213- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
1213+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
12141214 }
12151215 return hdle;
12161216 }
@@ -1219,7 +1219,7 @@
12191219 HRGN hdle = ((PFN_ExtCreateRegion)GET_ORIGIN_FUNC(ExtCreateRegion))(lpx, nCount, lpData);
12201220 if( hdle != nullptr )
12211221 {
1222- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
1222+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteObject));
12231223 }
12241224 return hdle;
12251225 }
@@ -1231,7 +1231,7 @@
12311231 BOOL ret = ((PFN_DeleteEnhMetaFile)GET_ORIGIN_FUNC(DeleteEnhMetaFile))(hObject);
12321232 if( ret )
12331233 {
1234- CObjLeakCheckImpl::GetInstance().Remove(hObject, GET_ORIGIN_FUNC(DeleteEnhMetaFile));
1234+ GetInstance().Remove(hObject, GET_ORIGIN_FUNC(DeleteEnhMetaFile));
12351235 }
12361236 return ret;
12371237 }
@@ -1240,7 +1240,7 @@
12401240 BOOL ret = ((PFN_DeleteMetaFile)GET_ORIGIN_FUNC(DeleteMetaFile))(hObject);
12411241 if( ret )
12421242 {
1243- CObjLeakCheckImpl::GetInstance().Remove(hObject, GET_ORIGIN_FUNC(DeleteEnhMetaFile));
1243+ GetInstance().Remove(hObject, GET_ORIGIN_FUNC(DeleteEnhMetaFile));
12441244 }
12451245 return ret;
12461246 }
@@ -1249,7 +1249,7 @@
12491249 HENHMETAFILE hdle = ((PFN_CloseEnhMetaFile)GET_ORIGIN_FUNC(CloseEnhMetaFile))(hdc);
12501250 if( hdle != nullptr )
12511251 {
1252- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteEnhMetaFile));
1252+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteEnhMetaFile));
12531253 }
12541254 return hdle;
12551255 }
@@ -1258,7 +1258,7 @@
12581258 HENHMETAFILE hdle = ((PFN_CloseMetaFile)GET_ORIGIN_FUNC(CloseMetaFile))(hdc);
12591259 if( hdle != nullptr )
12601260 {
1261- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteEnhMetaFile));
1261+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteEnhMetaFile));
12621262 }
12631263 return hdle;
12641264 }
@@ -1267,7 +1267,7 @@
12671267 HENHMETAFILE hdle = ((PFN_CopyEnhMetaFileA)GET_ORIGIN_FUNC(CopyEnhMetaFileA))(hEnh, lpFileName);
12681268 if( hdle != nullptr )
12691269 {
1270- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteEnhMetaFile));
1270+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteEnhMetaFile));
12711271 }
12721272 return hdle;
12731273 }
@@ -1276,7 +1276,7 @@
12761276 HENHMETAFILE hdle = ((PFN_CopyEnhMetaFileW)GET_ORIGIN_FUNC(CopyEnhMetaFileW))(hEnh, lpFileName);
12771277 if( hdle != nullptr )
12781278 {
1279- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteEnhMetaFile));
1279+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteEnhMetaFile));
12801280 }
12811281 return hdle;
12821282 }
@@ -1285,7 +1285,7 @@
12851285 HENHMETAFILE hdle = ((PFN_CopyMetaFileA)GET_ORIGIN_FUNC(CopyMetaFileA))(hEnh, lpFileName);
12861286 if( hdle != nullptr )
12871287 {
1288- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteEnhMetaFile));
1288+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteEnhMetaFile));
12891289 }
12901290 return hdle;
12911291 }
@@ -1294,7 +1294,7 @@
12941294 HENHMETAFILE hdle = ((PFN_CopyMetaFileW)GET_ORIGIN_FUNC(CopyMetaFileW))(hEnh, lpFileName);
12951295 if( hdle != nullptr )
12961296 {
1297- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteEnhMetaFile));
1297+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(DeleteEnhMetaFile));
12981298 }
12991299 return hdle;
13001300 }
@@ -1306,7 +1306,7 @@
13061306 BOOL ret = ((PFN_DeleteDC)GET_ORIGIN_FUNC(DeleteDC))(hObject);
13071307 if( ret )
13081308 {
1309- CObjLeakCheckImpl::GetInstance().Remove(hObject, GET_ORIGIN_FUNC(DeleteDC));
1309+ GetInstance().Remove(hObject, GET_ORIGIN_FUNC(DeleteDC));
13101310 }
13111311 return ret;
13121312 }
@@ -1315,7 +1315,7 @@
13151315 HDC hdc = ((PFN_CreateDCA)GET_ORIGIN_FUNC(CreateDCA))(pwszDriver, pwszDevice, pszPort, pdm);
13161316 if( hdc != nullptr )
13171317 {
1318- CObjLeakCheckImpl::GetInstance().Add(hdc, GET_ORIGIN_FUNC(DeleteDC));
1318+ GetInstance().Add(hdc, GET_ORIGIN_FUNC(DeleteDC));
13191319 }
13201320 return hdc;
13211321 }
@@ -1324,7 +1324,7 @@
13241324 HDC hdc = ((PFN_CreateDCW)GET_ORIGIN_FUNC(CreateDCW))(pwszDriver, pwszDevice, pszPort, pdm);
13251325 if( hdc != nullptr )
13261326 {
1327- CObjLeakCheckImpl::GetInstance().Add(hdc, GET_ORIGIN_FUNC(DeleteDC));
1327+ GetInstance().Add(hdc, GET_ORIGIN_FUNC(DeleteDC));
13281328 }
13291329 return hdc;
13301330 }
@@ -1333,7 +1333,7 @@
13331333 HDC hdc = ((PFN_CreateCompatibleDC)GET_ORIGIN_FUNC(CreateCompatibleDC))(hDC);
13341334 if( hdc != nullptr )
13351335 {
1336- CObjLeakCheckImpl::GetInstance().Add(hdc, GET_ORIGIN_FUNC(DeleteDC));
1336+ GetInstance().Add(hdc, GET_ORIGIN_FUNC(DeleteDC));
13371337 }
13381338 return hdc;
13391339 }
@@ -1342,7 +1342,7 @@
13421342 HDC hdc = ((PFN_GetDC)GET_ORIGIN_FUNC(GetDC))(hWnd);
13431343 if( hdc != nullptr )
13441344 {
1345- CObjLeakCheckImpl::GetInstance().Add(hdc, GET_ORIGIN_FUNC(ReleaseDC));
1345+ GetInstance().Add(hdc, GET_ORIGIN_FUNC(ReleaseDC));
13461346 }
13471347 return hdc;
13481348 }
@@ -1351,7 +1351,7 @@
13511351 BOOL ret = ((PFN_ReleaseDC)GET_ORIGIN_FUNC(ReleaseDC))(hWnd, hObject);
13521352 if( ret )
13531353 {
1354- CObjLeakCheckImpl::GetInstance().Remove(hObject, GET_ORIGIN_FUNC(ReleaseDC));
1354+ GetInstance().Remove(hObject, GET_ORIGIN_FUNC(ReleaseDC));
13551355 }
13561356 return ret;
13571357 }
@@ -1364,7 +1364,7 @@
13641364 BOOL ret = ((PFN_HeapDestroy)GET_ORIGIN_FUNC(HeapDestroy))(hObject);
13651365 if( ret )
13661366 {
1367- CObjLeakCheckImpl::GetInstance().Remove(hObject, GET_ORIGIN_FUNC(HeapDestroy));
1367+ GetInstance().Remove(hObject, GET_ORIGIN_FUNC(HeapDestroy));
13681368 }
13691369 return ret;
13701370 }
@@ -1373,7 +1373,7 @@
13731373 HANDLE hdle = ((PFN_HeapCreate)GET_ORIGIN_FUNC(HeapCreate))(dwOptions, InitialSize, MaximumSize);
13741374 if( hdle != nullptr )
13751375 {
1376- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(HeapDestroy));
1376+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(HeapDestroy));
13771377 }
13781378 return hdle;
13791379 }
@@ -1383,7 +1383,7 @@
13831383 BOOL ret = ((PFN_LocalFree)GET_ORIGIN_FUNC(LocalFree))(hObject);
13841384 if( ret )
13851385 {
1386- CObjLeakCheckImpl::GetInstance().Remove(hObject, GET_ORIGIN_FUNC(LocalFree));
1386+ GetInstance().Remove(hObject, GET_ORIGIN_FUNC(LocalFree));
13871387 }
13881388 return ret;
13891389 }
@@ -1390,10 +1390,10 @@
13901390 HOOK_FUNC(HLOCAL, LocalReAlloc , (HLOCAL hObject, SIZE_T uBytes, UINT uFlags))
13911391 {
13921392 HLOCAL hdle = ((PFN_LocalReAlloc)GET_ORIGIN_FUNC(LocalReAlloc))(hObject, uBytes, uFlags);
1393- CObjLeakCheckImpl::GetInstance().Remove(hObject, GET_ORIGIN_FUNC(LocalFree));
1393+ GetInstance().Remove(hObject, GET_ORIGIN_FUNC(LocalFree));
13941394 if( hdle != nullptr )
13951395 {
1396- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(LocalFree));
1396+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(LocalFree));
13971397 }
13981398 return hdle;
13991399 }
@@ -1402,7 +1402,7 @@
14021402 HLOCAL hdle = ((PFN_LocalAlloc)GET_ORIGIN_FUNC(LocalAlloc))(uFlags, uBytes);
14031403 if( hdle != nullptr )
14041404 {
1405- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(LocalFree));
1405+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(LocalFree));
14061406 }
14071407 return hdle;
14081408 }
@@ -1412,7 +1412,7 @@
14121412 BOOL ret = ((PFN_GlobalFree)GET_ORIGIN_FUNC(GlobalFree))(hObject);
14131413 if( ret )
14141414 {
1415- CObjLeakCheckImpl::GetInstance().Remove(hObject, GET_ORIGIN_FUNC(GlobalFree));
1415+ GetInstance().Remove(hObject, GET_ORIGIN_FUNC(GlobalFree));
14161416 }
14171417 return ret;
14181418 }
@@ -1419,10 +1419,10 @@
14191419 HOOK_FUNC(HGLOBAL, GlobalReAlloc , (HLOCAL hObject, SIZE_T uBytes, UINT uFlags))
14201420 {
14211421 HLOCAL hdle = ((PFN_GlobalReAlloc)GET_ORIGIN_FUNC(GlobalReAlloc))(hObject, uBytes, uFlags);
1422- CObjLeakCheckImpl::GetInstance().Remove(hObject, GET_ORIGIN_FUNC(GlobalFree));
1422+ GetInstance().Remove(hObject, GET_ORIGIN_FUNC(GlobalFree));
14231423 if( hdle != nullptr )
14241424 {
1425- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(GlobalFree));
1425+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(GlobalFree));
14261426 }
14271427 return hdle;
14281428 }
@@ -1431,7 +1431,7 @@
14311431 HGLOBAL hdle = ((PFN_GlobalAlloc)GET_ORIGIN_FUNC(GlobalAlloc))(uFlags, uBytes);
14321432 if( hdle != nullptr )
14331433 {
1434- CObjLeakCheckImpl::GetInstance().Add(hdle, GET_ORIGIN_FUNC(GlobalFree));
1434+ GetInstance().Add(hdle, GET_ORIGIN_FUNC(GlobalFree));
14351435 }
14361436 return hdle;
14371437 }
--- trunk/framework/src/platform/windows/win/debug/dbghelp/WXObjLeakCheck.h (revision 265)
+++ trunk/framework/src/platform/windows/win/debug/dbghelp/WXObjLeakCheck.h (revision 266)
@@ -19,7 +19,6 @@
1919
2020 //======================================================================
2121 // include
22-#include "WXProcHook.h"
2322 #include "../../../../../fnd/container/FndSingleton.h"
2423
2524 #ifdef _IRIS_DEBUG
@@ -46,13 +45,13 @@
4645 public:
4746 typedef enum
4847 {
49- HOOKTARGET_HANDLE = 0x00000001,
50- HOOKTARGET_FINDFILE = 0x00000002,
51- HOOKTARGET_REG = 0x00000004,
52- HOOKTARGET_GDI = 0x00000010,
53- HOOKTARGET_METAFILE = 0x00000020,
54- HOOKTARGET_DC = 0x00000080,
55- HOOKTARGET_HEAP = 0x00000100,
48+ HOOKTARGET_HANDLE = 0x00000001, //!< HANDLE
49+ HOOKTARGET_FINDFILE = 0x00000002, //!< FindFile
50+ HOOKTARGET_REG = 0x00000004, //!< Registry
51+ HOOKTARGET_GDI = 0x00000010, //!< GDI Handle
52+ HOOKTARGET_METAFILE = 0x00000020, //!< Meta File
53+ HOOKTARGET_DC = 0x00000080, //!< Device Context
54+ HOOKTARGET_HEAP = 0x00000100, //!< HEAP
5655 HOOKTARGET_ALL = 0xffffffff,
5756 } HOOKTARGET;
5857 public:
--- trunk/framework/src/platform/windows/win/xml/WXMSXMLNode.cpp (revision 265)
+++ trunk/framework/src/platform/windows/win/xml/WXMSXMLNode.cpp (revision 266)
@@ -19,7 +19,7 @@
1919 //======================================================================
2020 // include
2121 #include "WXMSXMLNode.h"
22-#include <tchar.h>
22+#include "iris_tchar.h"
2323
2424 #include "iris_debug.h"
2525
--- trunk/framework/src/platform/windows/win/rtl/WXRtlBackTrace.h (revision 265)
+++ trunk/framework/src/platform/windows/win/rtl/WXRtlBackTrace.h (revision 266)
@@ -29,7 +29,7 @@
2929 * @brief RTL バックトレース
3030 */
3131 template<int N>
32-class CRTLBackTrace : public IIrisObject
32+class CRtlBackTrace : public IIrisObject
3333 {
3434 static const int NUM = N;
3535
@@ -36,7 +36,7 @@
3636 void* m_Stack[N];
3737 WORD m_Count;
3838 public:
39- CRTLBackTrace(void)
39+ CRtlBackTrace(void)
4040 : m_Count(0)
4141 {
4242 m_Count = CNtDllModule::RtlCaptureStackBackTrace(2, NUM, m_Stack, nullptr);
--- trunk/framework/src/audio/al/AXALPlayer.cpp (revision 265)
+++ trunk/framework/src/audio/al/AXALPlayer.cpp (revision 266)
@@ -127,14 +127,14 @@
127127 if( (err_code == AL_NO_ERROR) && static_cast<AXALU32>(join_buf) != buffer )
128128 {
129129 seti(AL_BUFFER, buffer);
130- DetachSubjectAll();
131- AttachSubject(pBuffer);
130+ DetachObserverAll();
131+ AttachObserver(pBuffer);
132132 }
133133 }
134134 else
135135 {
136136 seti(AL_BUFFER, AL_NONE);
137- DetachSubjectAll();
137+ DetachObserverAll();
138138 }
139139 AXAL_DO_CHECK_RESULT(alGetError(), return false);
140140 return true;
@@ -157,12 +157,12 @@
157157 if( buffer == 0 ) return false;
158158 alSourceQueueBuffers(m_Source, 1, &buffer);
159159 AXAL_DO_CHECK_RESULT(alGetError(), return false);
160- AttachSubject(pBuffer);
160+ AttachObserver(pBuffer);
161161 return true;
162162 }
163163
164164 seti(AL_BUFFER, AL_NONE);
165- DetachSubjectAll();
165+ DetachObserverAll();
166166 AXAL_DO_CHECK_RESULT(alGetError(), return false);
167167 return true;
168168 }
@@ -182,13 +182,13 @@
182182 alSourceUnqueueBuffers(m_Source, num, lpBuffers);
183183 for( AXALSIZEI i=0; i < num; ++i )
184184 {
185- CALBuffer* buffer = GetSubjects();
185+ CALBuffer* buffer = GetObservers();
186186 while(1)
187187 {
188188 if( buffer == nullptr ) return false;
189189 if( buffer->GetBuffer() == lpBuffers[i] )
190190 {
191- DetachSubject(buffer);
191+ DetachObserver(buffer);
192192 break;
193193 }
194194 buffer = buffer->GetNext();
@@ -211,13 +211,13 @@
211211 {
212212 AXALU32 dequeue_buffer;
213213 alSourceUnqueueBuffers(m_Source, 1, &dequeue_buffer);
214- CALBuffer* buffer = GetSubjects();
214+ CALBuffer* buffer = GetObservers();
215215 while(1)
216216 {
217217 if( buffer == nullptr ) return false;
218218 if( buffer->GetBuffer() == dequeue_buffer )
219219 {
220- DetachSubject(buffer);
220+ DetachObserver(buffer);
221221 break;
222222 }
223223 buffer = buffer->GetNext();
@@ -795,7 +795,7 @@
795795 void CALPlayer::OnDetach(CALBuffer* subject)
796796 {
797797 IRIS_ASSERT( subject != nullptr );
798- if( subject->GetObserver() != nullptr ) return; // 監視者が消した場合は、自分のはず
798+ if( subject->GetSubject() != nullptr ) return; // 監視者が消した場合は、自分のはず
799799 AXALU32 buffer = subject->GetBuffer();
800800 if( buffer == 0 ) return;
801801 // 再生済みバッファにあればそれでよし
--- trunk/framework/src/audio/al/AXALBuffer.h (revision 265)
+++ trunk/framework/src/audio/al/AXALBuffer.h (revision 266)
@@ -35,7 +35,7 @@
3535 * @ingroup OpenAL
3636 * @brief OpenALバッファクラス
3737 */
38-class CALBuffer : public fnd::CObserverSubject<CALBuffer>
38+class CALBuffer : public fnd::CObserver<CALBuffer>
3939 {
4040 protected:
4141 AXALU32 m_Buffer; //!< バッファ
@@ -68,7 +68,7 @@
6868 // バッファが有効かどうか
6969 bool IsValid(void) const;
7070 //! プレイヤーに登録されているか
71- bool IsRegistPlayer(void) const { return (GetObserver() != nullptr); }
71+ bool IsRegistPlayer(void) const { return (GetSubject() != nullptr); }
7272
7373 public:
7474 //! バッファの取得
--- trunk/framework/src/audio/al/AXALPlayer.h (revision 265)
+++ trunk/framework/src/audio/al/AXALPlayer.h (revision 266)
@@ -39,7 +39,7 @@
3939 * @ingroup OpenAL
4040 * @biref OpenALプレイヤークラス
4141 */
42-class CALPlayer : protected fnd::CObserver<CALBuffer>
42+class CALPlayer : protected fnd::CObserverSubject<CALBuffer>
4343 {
4444 public:
4545 static const AXALS32 VOLUME_MAX = 4096; //!< ボリューム最大値
--- trunk/framework/src/script/angelscript/as_inchead.h (nonexistent)
+++ trunk/framework/src/script/angelscript/as_inchead.h (revision 266)
@@ -0,0 +1,35 @@
1+//======================================================================
2+//-----------------------------------------------------------------------
3+/**
4+ * @file as_inchead.h
5+ * @brief as_inchead ファイル
6+ *
7+ * @author t.sirayanagi
8+ * @version 1.0
9+ *
10+ * @par copyright
11+ * Copyright (C) 2012 Takazumi Shirayanagi\n
12+ * The new BSD License is applied to this software.
13+ * see iris_LICENSE.txt
14+*/
15+//-----------------------------------------------------------------------
16+//======================================================================
17+#ifndef INCG_IRIS_as_inchead_H_
18+#define INCG_IRIS_as_inchead_H_
19+
20+//======================================================================
21+// include
22+#include "../../iris_inchead.h"
23+
24+#ifdef _IRIS_SUPPORT_ANGELSCRIPT
25+
26+#include <angelscript.h>
27+
28+/**
29+ * @defgroup as
30+*/
31+
32+
33+#endif
34+
35+#endif
--- trunk/framework/src/script/angelscript/AsContext.cpp (nonexistent)
+++ trunk/framework/src/script/angelscript/AsContext.cpp (revision 266)
@@ -0,0 +1,131 @@
1+//======================================================================
2+//-----------------------------------------------------------------------
3+/**
4+ * @file AsContext.cpp
5+ * @brief AsContext ファイル
6+ *
7+ * @author t.sirayanagi
8+ * @version 1.0
9+ *
10+ * @par copyright
11+ * Copyright (C) 2012 Takazumi Shirayanagi\n
12+ * The new BSD License is applied to this software.
13+ * see iris_LICENSE.txt
14+*/
15+//-----------------------------------------------------------------------
16+//======================================================================
17+#define INCG_IRIS_AsContext_CPP_
18+
19+//======================================================================
20+// include
21+#include "AsContext.h"
22+#include "../../iris_debug.h"
23+
24+#ifdef _IRIS_SUPPORT_ANGELSCRIPT
25+
26+namespace iris {
27+namespace as
28+{
29+
30+/**********************************************************************//**
31+ *
32+ * コンストラクタ
33+ *
34+*//***********************************************************************/
35+CAsContext::CAsContext(void)
36+: m_pContext(nullptr)
37+{
38+}
39+
40+/**********************************************************************//**
41+ *
42+ * デストラクタ
43+ *
44+*//***********************************************************************/
45+CAsContext::~CAsContext(void)
46+{
47+ Terminate();
48+}
49+
50+/**********************************************************************//**
51+ *
52+ * 関数登録
53+ *
54+ -----------------------------------------------------------------------
55+ * @param [in] funcId = 関数ID
56+ * @return 成否
57+*//***********************************************************************/
58+bool CAsContext::Prepare(int funcId)
59+{
60+ IRIS_ASSERT( m_pContext != nullptr );
61+ int ret = m_pContext->Prepare(funcId);
62+ return ret >= 0;
63+}
64+
65+/**********************************************************************//**
66+ *
67+ * 関数登録
68+ *
69+ -----------------------------------------------------------------------
70+ * @param [in] func = 関数
71+ * @return 成否
72+*//***********************************************************************/
73+bool CAsContext::Prepare(asIScriptFunction* func)
74+{
75+ IRIS_ASSERT( m_pContext != nullptr );
76+ int ret = m_pContext->Prepare(func);
77+ return ret >= 0;
78+}
79+
80+/**********************************************************************//**
81+ *
82+ * 実行
83+ *
84+ -----------------------------------------------------------------------
85+ * @return 成否
86+*//***********************************************************************/
87+bool CAsContext::Execute(void)
88+{
89+ IRIS_ASSERT( m_pContext != nullptr );
90+ return false;
91+}
92+
93+/**********************************************************************//**
94+ *
95+ * 終了処理
96+ *
97+*//***********************************************************************/
98+void CAsContext::Terminate(void)
99+{
100+ // abort
101+ Abort();
102+ IRIS_SAFE_RELEASE(m_pContext);
103+}
104+
105+/**********************************************************************//**
106+ *
107+ * 強制停止
108+ *
109+*//***********************************************************************/
110+void CAsContext::Abort(void)
111+{
112+ IRIS_ASSERT( m_pContext != nullptr );
113+ m_pContext->Abort();
114+}
115+
116+/**********************************************************************//**
117+ *
118+ * 有効な状態かどうか
119+ *
120+ -----------------------------------------------------------------------
121+ * @return 真偽値
122+*//***********************************************************************/
123+bool CAsContext::IsValid(void) const
124+{
125+ return m_pContext != nullptr;
126+}
127+
128+} // end of namespace as
129+} // end of namespace iris
130+
131+#endif
--- trunk/framework/src/script/angelscript/AsSystem.cpp (nonexistent)
+++ trunk/framework/src/script/angelscript/AsSystem.cpp (revision 266)
@@ -0,0 +1,120 @@
1+//======================================================================
2+//-----------------------------------------------------------------------
3+/**
4+ * @file AsSystem.cpp
5+ * @brief AsSystem ファイル
6+ *
7+ * @author t.sirayanagi
8+ * @version 1.0
9+ *
10+ * @par copyright
11+ * Copyright (C) 2012 Takazumi Shirayanagi\n
12+ * The new BSD License is applied to this software.
13+ * see iris_LICENSE.txt
14+*/
15+//-----------------------------------------------------------------------
16+//======================================================================
17+#define INCG_IRIS_AsSystem_CPP_
18+
19+//======================================================================
20+// include
21+#include "AsSystem.h"
22+#include "../../iris_debug.h"
23+
24+#ifdef _IRIS_SUPPORT_ANGELSCRIPT
25+
26+//======================================================================
27+// link
28+#if defined(IRIS_MSC)
29+
30+#pragma comment (lib, "angelscript_static_" \
31+ IRIS_LIB_MODE \
32+ IRIS_LIB_VCVER \
33+ IRIS_LIB_X64 \
34+ IRIS_LIB_POSTFIX \
35+ ".lib")
36+#endif
37+
38+
39+namespace iris {
40+namespace as
41+{
42+
43+/**********************************************************************//**
44+ *
45+ * コンストラクタ
46+ *
47+*//***********************************************************************/
48+CAsSystem::CAsSystem(void)
49+: m_pEngine(nullptr)
50+{
51+}
52+
53+/**********************************************************************//**
54+ *
55+ * デストラクタ
56+ *
57+*//***********************************************************************/
58+CAsSystem::~CAsSystem(void)
59+{
60+ Terminate();
61+}
62+
63+/**********************************************************************//**
64+ *
65+ * システム初期化
66+ *
67+*//***********************************************************************/
68+void CAsSystem::Initialize(void)
69+{
70+ m_pEngine = asCreateScriptEngine( ANGELSCRIPT_VERSION );
71+}
72+
73+/**********************************************************************//**
74+ *
75+ * 終了処理
76+ *
77+*//***********************************************************************/
78+void CAsSystem::Terminate(void)
79+{
80+ // context の終了
81+
82+ IRIS_SAFE_RELEASE(m_pEngine);
83+}
84+
85+/**********************************************************************//**
86+ *
87+ * コンテキスト作成
88+ *
89+ -----------------------------------------------------------------------
90+ * @param [out] context = 出力
91+ * @return 成否
92+*//***********************************************************************/
93+bool CAsSystem::CreateContext(CAsContext &context)
94+{
95+ context.Terminate();
96+ IRIS_ASSERT( m_pEngine != nullptr );
97+ asIScriptContext* p = m_pEngine->CreateContext();
98+ if( p == nullptr ) return false;
99+ context.m_pContext = p;
100+ AttachObserver(&context);
101+ return true;
102+}
103+
104+/**********************************************************************//**
105+ *
106+ * コンテキスト Detach
107+ *
108+ -----------------------------------------------------------------------
109+ * @param [in] context = デタッチコンテキスト
110+*//***********************************************************************/
111+void CAsSystem::OnDetach(CAsContext* context)
112+{
113+ IRIS_ASSERT( context != nullptr );
114+ context->Terminate();
115+}
116+
117+} // end of namespace as
118+} // end of namespace iris
119+
120+#endif
--- trunk/framework/src/script/angelscript/AsContext.h (nonexistent)
+++ trunk/framework/src/script/angelscript/AsContext.h (revision 266)
@@ -0,0 +1,69 @@
1+//======================================================================
2+//-----------------------------------------------------------------------
3+/**
4+ * @file AsContext.h
5+ * @brief angelscript システム ファイル
6+ *
7+ * @author t.sirayanagi
8+ * @version 1.0
9+ *
10+ * @par copyright
11+ * Copyright (C) 2012 Takazumi Shirayanagi\n
12+ * The new BSD License is applied to this software.
13+ * see iris_LICENSE.txt
14+*/
15+//-----------------------------------------------------------------------
16+//======================================================================
17+#ifndef INCG_IRIS_AsContext_H_
18+#define INCG_IRIS_AsContext_H_
19+
20+//======================================================================
21+// include
22+#include "as_inchead.h"
23+#include "fnd/container/FndObserver.h"
24+
25+#ifdef _IRIS_SUPPORT_ANGELSCRIPT
26+
27+namespace iris {
28+namespace as
29+{
30+
31+//======================================================================
32+// class
33+/**
34+ * @ingroup as
35+ * @brief AngelScript Context クラス
36+*/
37+class CAsContext : public fnd::CObserver<CAsContext>
38+{
39+ friend class CAsSystem;
40+protected:
41+ asIScriptContext* m_pContext; //!< コンテキスト
42+
43+public:
44+ // コンストラクタ
45+ CAsContext(void);
46+ // デストラクタ
47+ ~CAsContext(void);
48+
49+public:
50+ // 関数ID設定
51+ bool Prepare(int funcId);
52+ bool Prepare(asIScriptFunction* func);
53+ // 実効
54+ bool Execute(void);
55+ // 終了処理
56+ void Terminate(void);
57+ // 強制停止
58+ void Abort(void);
59+
60+ // 有効な状態かどうか
61+ bool IsValid(void) const;
62+};
63+
64+} // end of namespace as
65+} // end of namespace iris
66+
67+#endif
68+
69+#endif
--- trunk/framework/src/script/angelscript/AsSystem.h (nonexistent)
+++ trunk/framework/src/script/angelscript/AsSystem.h (revision 266)
@@ -0,0 +1,72 @@
1+//======================================================================
2+//-----------------------------------------------------------------------
3+/**
4+ * @file AsSystem.h
5+ * @brief angelscript システム ファイル
6+ *
7+ * @author t.sirayanagi
8+ * @version 1.0
9+ *
10+ * @par copyright
11+ * Copyright (C) 2010-2011 Takazumi Shirayanagi\n
12+ * The new BSD License is applied to this software.
13+ * see iris_LICENSE.txt
14+*/
15+//-----------------------------------------------------------------------
16+//======================================================================
17+#ifndef INCG_IRIS_AsSystem_H_
18+#define INCG_IRIS_AsSystem_H_
19+
20+//======================================================================
21+// include
22+#include "as_inchead.h"
23+#include "fnd/container/smart_ptr/FndRefCntPtr.h"
24+#include "AsContext.h"
25+
26+#ifdef _IRIS_SUPPORT_ANGELSCRIPT
27+
28+namespace iris {
29+namespace as
30+{
31+
32+//======================================================================
33+// class
34+/**
35+ * @ingroup as
36+ * @brief AngelScript System クラス
37+*/
38+class CAsSystem : public fnd::CObserverSubject<CAsContext>
39+{
40+ typedef fnd::CRefCntPtr<asIScriptEngine> ptr;
41+protected:
42+ asIScriptEngine* m_pEngine; //!< スクリプトエンジン
43+
44+public:
45+ // コンストラクタ
46+ CAsSystem(void);
47+ // デストラクタ
48+ ~CAsSystem(void);
49+
50+public:
51+ // 初期化
52+ void Initialize(void);
53+ // 終了処理
54+ void Terminate(void);
55+
56+public:
57+ // コンテキストの作成
58+ bool CreateContext(CAsContext& context);
59+
60+public:
61+ ptr GetEngine(void) const { return m_pEngine; }
62+
63+private:
64+ virtual void OnDetach(CAsContext* observer);
65+};
66+
67+} // end of namespace as
68+} // end of namespace iris
69+
70+#endif
71+
72+#endif
--- trunk/framework/src/fnd/container/FndScopedLock.h (revision 265)
+++ trunk/framework/src/fnd/container/FndScopedLock.h (revision 266)
@@ -8,7 +8,7 @@
88 * @version 1.0
99 *
1010 * @par copyright
11- * Copyright (C) 2010-2011 Takazumi Shirayanagi\n
11+ * Copyright (C) 2010-2012 Takazumi Shirayanagi\n
1212 * The new BSD License is applied to this software.
1313 * see iris_LICENSE.txt
1414 */
@@ -32,9 +32,9 @@
3232 * @tparam OBJECT = ロッククラス型
3333 */
3434 template<typename OBJECT>
35-class CScopedLock : private INonCopyable<>
35+class CSingleLock : private INonCopyable<>
3636 {
37- typedef CScopedLock<OBJECT> _Myt;
37+ typedef CSingleLock<OBJECT> _Myt;
3838 public:
3939 typedef OBJECT value_type;
4040 typedef OBJECT *value_ptr;
@@ -44,19 +44,18 @@
4444 bool m_lock; //!< lock状態
4545 public:
4646 /// コンストラクタ
47- CScopedLock(value_ref object)
47+ CSingleLock(value_ref object)
4848 : m_object(object), m_lock(false)
4949 {
5050 lock();
5151 }
52- /// コンストラクタ
53- CScopedLock(const _Myt& object)
54- : m_object(object.m_object), m_lock(false)
52+ CSingleLock(value_ref object, u32 uTimeout)
53+ : m_object(object), m_lock(false)
5554 {
56- lock();
55+ lock(uTimeout);
5756 }
5857 /// デストラクタ
59- ~CScopedLock(void)
58+ ~CSingleLock(void)
6059 {
6160 unlock();
6261 }
@@ -70,6 +69,15 @@
7069 m_lock = true;
7170 }
7271 }
72+ /// ロック
73+ void lock(u32 uTimeout)
74+ {
75+ if( !m_lock )
76+ {
77+ m_object.Lock(uTimeout);
78+ m_lock = true;
79+ }
80+ }
7381 /// ロック解除
7482 void unlock(void)
7583 {
--- trunk/framework/src/fnd/container/FndObserver.h (revision 265)
+++ trunk/framework/src/fnd/container/FndObserver.h (revision 266)
@@ -60,6 +60,8 @@
6060 _MyObserver* curr = static_cast<_MyObserver*>(m_pObservers);
6161 while(curr != nullptr)
6262 {
63+ OnDetach(static_cast<value_ptr>(curr));
64+
6365 curr->m_pSubject = nullptr;
6466 curr = static_cast<_MyObserver*>(curr->m_pNext);
6567 curr->m_pNext = nullptr;
--- trunk/framework/src/fnd/container/smart_ptr/FndRefPtr.h (revision 265)
+++ trunk/framework/src/fnd/container/smart_ptr/FndRefPtr.h (revision 266)
@@ -8,7 +8,7 @@
88 * @version 1.0
99 *
1010 * @par copyright
11- * Copyright (C) 2009-2011 Takazumi Shirayanagi\n
11+ * Copyright (C) 2009-2012 Takazumi Shirayanagi\n
1212 * The new BSD License is applied to this software.
1313 * see iris_LICENSE.txt
1414 */
@@ -115,7 +115,7 @@
115115 * コンストラクタ
116116 * @param [in] ref = リファレンスポインタ
117117 */
118- CRefPtr(const CRefPtr& ref)
118+ CRefPtr(const _Myt& ref)
119119 {
120120 m_ref = ref.m_ref;
121121 m_ref->inc_ref();
@@ -134,7 +134,7 @@
134134 /**
135135 * 代入
136136 */
137- const CRefPtr& operator = ( const CRefPtr& ref )
137+ const _Myt& operator = ( const _Myt& ref )
138138 {
139139 ref.m_ref->inc_ref();
140140 m_ref->dec_ref();
@@ -145,10 +145,10 @@
145145 return *this;
146146 }
147147
148- operator value_ptr (void) const { return m_ref->ptr(); }
149- value_ptr operator -> ( void ) const { return m_ref->ptr(); }
150- bool operator == (const CRefPtr& rhs) const { return m_ref->ptr() == rhs.m_ref->ptr(); }
151- bool operator != (const CRefPtr& rhs) const { return m_ref->ptr() != rhs.m_ref->ptr(); }
148+ operator value_ptr (void) const { return m_ref->ptr(); }
149+ value_ptr operator -> ( void ) const { return m_ref->ptr(); }
150+ bool operator == (const _Myt& rhs) const { return m_ref->ptr() == rhs.m_ref->ptr(); }
151+ bool operator != (const _Myt& rhs) const { return m_ref->ptr() != rhs.m_ref->ptr(); }
152152
153153 bool is_valid( void ) const { return m_ref->ptr() != nullptr; }
154154 bool is_invalid( void ) const { return m_ref->ptr() == nullptr; }
@@ -155,10 +155,10 @@
155155 value_ptr ptr( void ) const { return m_ref->ptr(); }
156156
157157 public:
158- static const CRefPtr& null( void )
158+ static const _Myt& null( void )
159159 {
160160 static CRefObj obj(nullptr);
161- static CRefPtr null_pointer(&obj);
161+ static _Myt null_pointer(&obj);
162162 return null_pointer;
163163 }
164164 };
--- trunk/framework/src/fnd/container/smart_ptr/FndRefCntPtr.h (nonexistent)
+++ trunk/framework/src/fnd/container/smart_ptr/FndRefCntPtr.h (revision 266)
@@ -0,0 +1,109 @@
1+//======================================================================
2+//-----------------------------------------------------------------------
3+/**
4+ * @file FndRefCntPtr.h
5+ * @brief Reference Pointer 抱合 クラスファイル
6+ *
7+ * @author t.sirayanagi
8+ * @version 1.0
9+ *
10+ * @par copyright
11+ * Copyright (C) 2012 Takazumi Shirayanagi\n
12+ * The new BSD License is applied to this software.
13+ * see iris_LICENSE.txt
14+*/
15+//-----------------------------------------------------------------------
16+//======================================================================
17+#ifndef INCG_IRIS_FndRefCntPtr_H_
18+#define INCG_IRIS_FndRefCntPtr_H_
19+
20+//======================================================================
21+// include
22+#include "../../../iris_object.h"
23+#include "../../../iris_debug.h"
24+
25+namespace iris {
26+namespace fnd
27+{
28+
29+//======================================================================
30+// class
31+/**
32+ * @brief 参照カウント方式ポインタ抱合クラス
33+*/
34+template< typename TN_>
35+class CRefCntPtr : public IIrisObject
36+{
37+ typedef CRefCntPtr<TN_> _Myt;
38+public:
39+ typedef TN_ value_type;
40+ typedef value_type *value_ptr;
41+
42+private:
43+ value_ptr m_ptr; //!< ポインタ
44+
45+public:
46+ /**
47+ * コンストラクタ
48+ * @param [in] ptr = ポインタ
49+ */
50+ CRefCntPtr(value_ptr ptr = nullptr)
51+ : m_ptr(nullptr)
52+ {
53+ if( ptr != nullptr )
54+ {
55+ ptr->AddRef();
56+ m_ptr = ptr;
57+ }
58+ }
59+
60+ /**
61+ * コンストラクタ
62+ */
63+ CRefCntPtr(const _Myt& rhs)
64+ : m_ptr(nullptr)
65+ {
66+ value_ptr ptr = rhs.m_ptr;
67+ if( ptr != nullptr )
68+ {
69+ ptr->AddRef();
70+ m_ptr = ptr;
71+ }
72+ }
73+ /**
74+ * デストラクタ
75+ */
76+ ~CRefCntPtr(void)
77+ {
78+ value_ptr ptr = m_ptr;
79+ m_ptr = nullptr;
80+ m_ptr->Release();
81+ }
82+
83+public:
84+ /**
85+ * 代入
86+ */
87+ const _Myt& operator = ( const _Myt& ref )
88+ {
89+ if( m_ptr != nullptr ) m_ptr->Release();
90+ value_ptr ptr = ref.m_ptr;
91+ if( ptr != nullptr ) ptr->AddRef();
92+ m_ptr = ptr;
93+ return *this;
94+ }
95+
96+ operator value_ptr (void) const { return m_ptr; }
97+ value_ptr operator -> ( void ) const { return m_ptr; }
98+ bool operator == (const _Myt& rhs) const { return m_ptr == rhs.m_ptr; }
99+ bool operator != (const _Myt& rhs) const { return m_ptr != rhs.m_ptr; }
100+
101+ bool is_valid( void ) const { return m_ptr != nullptr; }
102+ bool is_invalid( void ) const { return m_ptr == nullptr; }
103+ value_ptr ptr( void ) const { return m_ptr; }
104+};
105+
106+} // end of namespace fnd
107+} // end of namespace iris
108+
109+#endif
--- trunk/framework/src/fnd/utility/FndRefCounter.h (revision 265)
+++ trunk/framework/src/fnd/utility/FndRefCounter.h (revision 266)
@@ -8,7 +8,7 @@
88 * @version 1.0
99 *
1010 * @par copyright
11- * Copyright (C) 2009-2011 Takazumi Shirayanagi\n
11+ * Copyright (C) 2009-2012 Takazumi Shirayanagi\n
1212 * The new BSD License is applied to this software.
1313 * see iris_LICENSE.txt
1414 */
@@ -38,6 +38,7 @@
3838 CRefCounter(void) : m_reference(0) {}
3939 public:
4040 void AddRef(void) { ++m_reference; }
41+ void Release(void) { --m_reference; }
4142 void SubRef(void) { --m_reference; }
4243 int GetRef(void) const { return m_reference; }
4344 };
--- trunk/framework/src/fnd/types/FndSyncObject.h (revision 265)
+++ trunk/framework/src/fnd/types/FndSyncObject.h (revision 266)
@@ -8,7 +8,7 @@
88 * @version 1.0
99 *
1010 * @par copyright
11- * Copyright (C) 2009-2011 Takazumi Shirayanagi\n
11+ * Copyright (C) 2009-2012 Takazumi Shirayanagi\n
1212 * The new BSD License is applied to this software.
1313 * see iris_LICENSE.txt
1414 */
@@ -42,6 +42,8 @@
4242 public:
4343 /// ロック取得
4444 virtual bool Lock(void) = 0;
45+ /// ロック取得
46+ virtual bool Lock(u32 uTimeout) = 0;
4547 /// ロック解除
4648 virtual void Unlock(void) = 0;
4749 /// ロック取得
Show on old repository browser