hi, I coded this:
Qt Code:
  1. Ne::Ne(): {
  2. printf ("costructor \n");
  3. _w = new double[10];
  4. }
  5.  
  6. Ne::~Ne() {
  7. printf ("destructor \n");
  8. delete[] _w1;
  9.  
  10. }
  11. class Lay {
  12. std::vector <Ne> _ne;
  13. ...............
  14. }
  15. //in main.cpp
  16. lay._ne.resize(2); //here crash
To copy to clipboard, switch view to plain text mode 
I can see that when resize is called happen this:
Qt Code:
  1. costructor
  2. destructor
  3. destructor
  4. and crash......
To copy to clipboard, switch view to plain text mode 
I wonder why does 'destructor' start? and 2 times? crash reason maybe can be destroy 2 times the same portion of memory.....but ....
thanks