VC++ 2005 and STL std::bad_alloc in xtree
- From: RV <rvlebars@xxxxxxxxxxx>
- Date: Thu, 27 Aug 2009 01:02:56 -0700 (PDT)
Hello world,
I have a crash with my program in release mode only. I develop with VC+
+ 2005 Express Edition, I started my project with an empty win32
project and use the submodule:Window. My program is successfully
compiled in both mode debug and release but it is at the execution
that the crash comes. It when I replace DLL Multithread (/MTd) for
debug by DLL Multithread (/MT) for release mode.
My problem is quite simple :
class MyClass{
MyClass()
{
Do something or not....
}
map<string,int> myMap;
}
This simple class makes my program crash at the execution in release
mode. I have a message std::bad_alloc at 0x...... I modified release
mode options to generate debuging informations and to have the
possibility to use breakpoints. With breakpoints, I have seen that the
problem appears at the creation of the instance. I don't reach the
constructor code. The exception comes in the <xtree> file from the STL
librairie. But when I delete the line of the static allocation of
myMap :
class MyClass{
MyClass()
{
Do something or not....
}
//map<string,int> myMap;
}
The program doesn't crash and works as well as I don't use map or
sstream this kind of STL tools. It is so the static allocation of the
map that makes my program crash
My Visual C++ project is without MFC and without ATL. It is only a
Win32 project with /SUBSYSTEM:WINDOWS options to create a simple form,
I don't really need graphics but I need a hwnd to use a message loop.
Is this a known bug with STL and VC++ 2005 win32 project.
I saw this (url]http://msdn.microsoft.com/en-us/magazine/cc164087.aspx
[/url]
Is this problem in relation with my problem ???
Thanks
Hervé
.
- Follow-Ups:
- Re: VC++ 2005 and STL std::bad_alloc in xtree
- From: SPAMCOP User
- Re: VC++ 2005 and STL std::bad_alloc in xtree
- From: Andrew McLaren
- Re: VC++ 2005 and STL std::bad_alloc in xtree
- Prev by Date: Re: WinXP Defrag.
- Next by Date: Re: Slow computer - no malware/spyware
- Previous by thread: Re: Folder is opened automatically onpower up
- Next by thread: Re: VC++ 2005 and STL std::bad_alloc in xtree
- Index(es):
Relevant Pages
|