Commit e089295f authored by Alexandre Julliard's avatar Alexandre Julliard

ole32: Fix wrap-around bug in tick count comparison.

parent af734f96
...@@ -813,14 +813,17 @@ static void apartment_freeunusedlibraries(struct apartment *apt, DWORD delay) ...@@ -813,14 +813,17 @@ static void apartment_freeunusedlibraries(struct apartment *apt, DWORD delay)
real_delay = 0; 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); list_remove(&entry->entry);
COMPOBJ_DllList_ReleaseRef(entry->dll, TRUE); COMPOBJ_DllList_ReleaseRef(entry->dll, TRUE);
HeapFree(GetProcessHeap(), 0, entry); HeapFree(GetProcessHeap(), 0, entry);
} }
else else
{
entry->unload_time = GetTickCount() + real_delay; entry->unload_time = GetTickCount() + real_delay;
if (!entry->unload_time) entry->unload_time = 1;
}
} }
else if (entry->unload_time) else if (entry->unload_time)
entry->unload_time = 0; entry->unload_time = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment