Fixed possible segmentation fault while freeing size request caches.

This commit is contained in:
Tristan Van Berkom 2011-03-06 17:13:32 +09:00
parent 38b5c8cf45
commit 5989a6405f

View File

@ -112,7 +112,7 @@ clear_cache (SizeRequestCache *cache,
if (sizes)
{
for (i = 0; sizes[i] != NULL; i++)
for (i = 0; i < GTK_SIZE_REQUEST_CACHED_SIZES && sizes[i] != NULL; i++)
g_slice_free (SizeRequest, sizes[i]);
g_slice_free1 (sizeof (SizeRequest *) * GTK_SIZE_REQUEST_CACHED_SIZES, sizes);