Author: mladen.turk(a)jboss.com
Date: 2007-10-17 09:56:00 -0400 (Wed, 17 Oct 2007)
New Revision: 1121
Modified:
trunk/sight/native/os/windows/main.c
Log:
Make sure we call sight_main only once
Modified: trunk/sight/native/os/windows/main.c
===================================================================
--- trunk/sight/native/os/windows/main.c 2007-10-17 13:49:36 UTC (rev 1120)
+++ trunk/sight/native/os/windows/main.c 2007-10-17 13:56:00 UTC (rev 1121)
@@ -84,7 +84,8 @@
"jvm.dll"
};
-static HMODULE late_dll_handles[SYSDLL_defined] = { NULL, NULL, NULL, NULL };
+static HMODULE late_dll_handles[SYSDLL_defined] = { NULL, NULL, NULL,
+ NULL, NULL };
FARPROC sight_load_dll_func(sight_dlltoken_e fnLib, const char* fnName, int ordinal)
{
@@ -337,10 +338,16 @@
SIGHT_FREE_WSTRING(msg);
}
+static int main_called = 0;
+
apr_status_t sight_main(apr_pool_t *pool)
{
DWORD rc;
+ /* sight_main should be called only once per process */
+ if (main_called++)
+ return APR_SUCCESS;
+
GetSystemInfo(sight_osinf);
sight_osver->dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA);
GetVersionExA((LPOSVERSIONINFOA)sight_osver);