hammondt / googletest

Automatically exported from code.google.com/p/googletest
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Crash with /vd2 flag #159

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm using googletest with gtkmm. Gtkmm needs the compile flag /vd2 to work.
But with this flag, googletest crash in the destructor of the message class :

~Message() { delete ss_; } //gtest.h

If I comment the delete instruction, it works fine (with a memory leak maybe.)

~Message() { /*delete ss_;*/ }

I'm using googletest revision 266 on Windows Vista 64. I compile it with
MSVC 8.0Exp

Original issue reported on code.google.com by podi...@gmail.com on 25 Jun 2009 at 10:13

GoogleCodeExporter commented 9 years ago
Since this only affects a small number of users, we probably won't have time 
for it
until higher priority tasks have been done.  I encourage you to investigate why 
this
is happening and find a fix yourself.  I suspect it's a compiler bug.

Original comment by zhanyong...@gmail.com on 7 Aug 2009 at 4:04

GoogleCodeExporter commented 9 years ago
I don't think this is gtest's fault. If you try the following code with /vd2 
option,
the program will crash too. 

    std::string filename("sample.name");
    std::ofstream *ofs = new std::ofstream(filename.c_str(),std::ios::out);
        ofs->close();
        delete ofs;
But if you just link the gtkmm lib, I think it probably OK to remove the /vd2 
option. 

Original comment by zhangji...@gmail.com on 27 Nov 2009 at 5:44

GoogleCodeExporter commented 9 years ago
Closed as this is a compiler bug.

Original comment by w...@google.com on 10 Dec 2009 at 8:08