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