Commit b4372798 authored by kenton@google.com's avatar kenton@google.com

Fix final leak (win32 only).

parent 1fb3d394
...@@ -56,6 +56,12 @@ struct GoogleOnceInternal { ...@@ -56,6 +56,12 @@ struct GoogleOnceInternal {
CRITICAL_SECTION critical_section; CRITICAL_SECTION critical_section;
}; };
GoogleOnceType::~GoogleOnceType()
{
delete internal_;
internal_ = NULL;
}
GoogleOnceType::GoogleOnceType() { GoogleOnceType::GoogleOnceType() {
// internal_ may be non-NULL if Init() was already called. // internal_ may be non-NULL if Init() was already called.
if (internal_ == NULL) internal_ = new GoogleOnceInternal; if (internal_ == NULL) internal_ = new GoogleOnceInternal;
......
...@@ -87,6 +87,7 @@ struct GoogleOnceInternal; ...@@ -87,6 +87,7 @@ struct GoogleOnceInternal;
struct LIBPROTOBUF_EXPORT GoogleOnceType { struct LIBPROTOBUF_EXPORT GoogleOnceType {
GoogleOnceType(); GoogleOnceType();
~GoogleOnceType();
void Init(void (*init_func)()); void Init(void (*init_func)());
volatile bool initialized_; volatile bool initialized_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment