Status: New
Owner: liuj...@google.com
Labels: Type-Defect Priority-Medium

New issue 675 by vxm...@gmail.com: memory leak
https://code.google.com/p/protobuf/issues/detail?id=675

A memory leak is detected by vld(visual leak detector).
I think the problem is caused by this function:
void InitEmptyString() {
  empty_string_ = new string;
}
empty_string_ will not be deleted later.

In previous version protobuf-2.5.0, empty string is a global std::string
const ::std::string kEmptyString;




protobuf version: protobuf-2.6.0
OS: windows 8.1
build env: visual studio 2013

Some output generated by vld:
d:\sdk\protobuf\protobuf-2.6.0\src\google\protobuf\generated_message_util.cc (55): ChatServerd.exe!google::protobuf::internal::InitEmptyString + 0x7 bytes d:\sdk\protobuf\protobuf-2.6.0\src\google\protobuf\stubs\common.h (876): ChatServerd.exe!google::protobuf::internal::FunctionClosure0::Run + 0xA bytes d:\sdk\protobuf\protobuf-2.6.0\src\google\protobuf\stubs\once.cc (83): ChatServerd.exe!google::protobuf::GoogleOnceInitImpl + 0xF bytes d:\sdk\protobuf\protobuf-2.6.0\src\google\protobuf\stubs\once.h (127): ChatServerd.exe!google::protobuf::GoogleOnceInit + 0xD bytes d:\sdk\protobuf\protobuf-2.6.0\src\google\protobuf\generated_message_util.h (84): ChatServerd.exe!google::protobuf::internal::GetEmptyString + 0xF bytes

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to