fix cache initialization/destroy leak