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
Original issue reported on code.google.com by vxm...@gmail.com on 20 Oct 2014 at 1:54
Original issue reported on code.google.com by
vxm...@gmail.com
on 20 Oct 2014 at 1:54