Fix final leak (win32 only).

This commit is contained in:
kenton@google.com 2009-05-18 18:38:56 +00:00
parent 1fb3d394e5
commit b43727981c
2 changed files with 7 additions and 0 deletions

View File

@ -56,6 +56,12 @@ struct GoogleOnceInternal {
CRITICAL_SECTION critical_section;
};
GoogleOnceType::~GoogleOnceType()
{
delete internal_;
internal_ = NULL;
}
GoogleOnceType::GoogleOnceType() {
// internal_ may be non-NULL if Init() was already called.
if (internal_ == NULL) internal_ = new GoogleOnceInternal;

View File

@ -87,6 +87,7 @@ struct GoogleOnceInternal;
struct LIBPROTOBUF_EXPORT GoogleOnceType {
GoogleOnceType();
~GoogleOnceType();
void Init(void (*init_func)());
volatile bool initialized_;