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

This commit is contained in:
Alexandre Julliard 2013-01-24 15:15:25 +01:00
parent af734f9623
commit e089295f75

View File

@ -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;