STL map instance causing UMR?

C

Chage

I declared something like this and caught an UMR by using Purify.

main()
{
map<string, string> x;
exit(0);
}

below are part of the purify message:
map()
: _Mybase(key_compare(), allocator_type())
=> { // construct empty map from defaults
}

explicit map(const key_compare& _Pred)

Anyone has encountered this before? I am using VC++.Net ver7.0.9466
 
R

Rolf Magnus

Chage said:
I declared something like this and caught an UMR by using Purify.

main()
{
map<string, string> x;
exit(0);
}

The problem is not the map, but the use of the function exit(). It
doesn't call the destructors of local objects. Try just returning from
main().
 
R

Ron Natalie

Rolf Magnus said:
The problem is not the map, but the use of the function exit(). It
doesn't call the destructors of local objects. Try just returning from
main().
That wouldn't have any bearing on a UMR. UMR is unitialized memory
references. Unfortunately, the entire VC++ runtime system is full
of them.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,148
Messages
2,570,834
Members
47,380
Latest member
AlinaBlevi

Latest Threads

Top