Module: wine Branch: master Commit: e089295f75cf9db2557418d644c72bc9ba55e70a URL: http://source.winehq.org/git/wine.git/?a=commit;h=e089295f75cf9db2557418d644...
Author: Alexandre Julliard julliard@winehq.org Date: Thu Jan 24 15:15:25 2013 +0100
ole32: Fix wrap-around bug in tick count comparison.
---
dlls/ole32/compobj.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c index 630e016..dc2a02b 100644 --- a/dlls/ole32/compobj.c +++ b/dlls/ole32/compobj.c @@ -813,14 +813,17 @@ static void apartment_freeunusedlibraries(struct apartment *apt, DWORD delay) real_delay = 0; }
- if (!real_delay || (entry->unload_time && (entry->unload_time < GetTickCount()))) + if (!real_delay || (entry->unload_time && ((int)(GetTickCount() - entry->unload_time) > 0))) { list_remove(&entry->entry); COMPOBJ_DllList_ReleaseRef(entry->dll, TRUE); HeapFree(GetProcessHeap(), 0, entry); } else + { entry->unload_time = GetTickCount() + real_delay; + if (!entry->unload_time) entry->unload_time = 1; + } } else if (entry->unload_time) entry->unload_time = 0;