diff options
Diffstat (limited to 'win32/time.c')
-rw-r--r-- | win32/time.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/win32/time.c b/win32/time.c index dfcc46a59b..a0ed1b344e 100644 --- a/win32/time.c +++ b/win32/time.c @@ -39,20 +39,21 @@ static zend_always_inline MyGetSystemTimeAsFileTime get_time_func(void) /* Max possible resolution <1us, win8/server2012 */ timefunc = (MyGetSystemTimeAsFileTime)GetProcAddress(hMod, "GetSystemTimePreciseAsFileTime"); - if(!timefunc) { - /* 100ns blocks since 01-Jan-1641 */ - timefunc = (MyGetSystemTimeAsFileTime)GetProcAddress(hMod, "GetSystemTimeAsFileTime"); - } + /* Lower the refcount */ + FreeLibrary(hMod); + } + + if(!timefunc) { + /* 100ns blocks since 01-Jan-1641 */ + timefunc = (MyGetSystemTimeAsFileTime) GetSystemTimeAsFileTime; } return timefunc; } -BOOL php_win32_init_gettimeofday(void) +void php_win32_init_gettimeofday(void) { timefunc = get_time_func(); - - return (NULL != timefunc); } #endif |