google/leveldb — pull request #3 by njwhite (2014-08-29 15:59:33+00:00)
Title: Fix Ref-Counting Error in Versions

Fixes #136. References to a DBImpl's VersionSet can be left in the
LRUCache, so delete the cache before the VersionSet.

Also stores the current version a local variable when references several times in a function to avoid race conditions.