Class breaks down because of additional std::string. Why?

Mikael Svensson minisip at mikaelsvensson.info
Fri Aug 10 11:32:54 CEST 2007


Hello

I need some debugging help... For some reason this class I'm developing 
causes "malloc(): memory corruption" when I add a new private 
std::string called "test" to the class.

This is an excerpt of the class:
<CODE>
class LIBMCRYPTO_API CacheManager : public MObject {
[snip]
	private:
		std::string getNewDirectorySetKey() const;
		std::string getNewCertificateSetKey() const;

		std::map<std::string, MRef<CertificateSet*> > a;
[snip]
		std::string test;
		int dummy;
}
</CODE>

Does anyone know why the application crashes when I include "std::string 
test" in the class definition? The variable "test" is never used in any 
function. If I remove the "test" variable everything works fine...

As a note I might add that I get the same error when trying to add more 
"list" and "map" variables but *not* when adding more "int" variables. 
What is it that is so special about classes that they cause memory 
corruption just by "being there"?

Regards
Mikael


More information about the Minisip-devel mailing list