I think there might be a race here -- what happens if one of the pcre_cache_entry pointers in the cache is live on another request when you reinitialize the cache?