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
1 changed files with 4 additions and 1 deletions

View File

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