Andrew Nicols 70aa00de87 MDL-56748 cache: Removes cache definition instances in purge_store
Previously a purge_store was only purging caches but it was leaving a
reference to the store instance for the cache definition.

As a result, the cache was never cleared away correctly and, in cases
where the cache store makes a TCP connection to a backend system, the
number of open sockets was increasing for each store instance.

After a complete purge, as found in the unit test reset, the cache
definitions should be both purged and removed.

This change should also lead to a drop in memory consumption for unit
tests as there will no longer be references to unused definition stores.
2016-11-04 13:26:46 +08:00
..