This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/22609] delete [] called on base virtual destructor class [Segmentation failed]


------- Additional Comments From bangerth at dealii dot org  2005-07-22 13:24 -------
You can't do this:  
  BaseVector* v = new Vector[10];  
  delete [] v; // <----- Here it is crashed  
The type of the data allocated is Vector*, which is what you have  
to use when you deallocate it. However, in your call to delete[] you 
use BaseVector*. 
  
W.  

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22609


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]