Problem with de allocating dynamic memory in desrtuctor

my program runs well when I do not delete the double pointers(int **).When i try to delete , the program crashes. However in the debug session i found, it is due to destructor.

Err: No source available for "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string() at 0x4485fe"

please help me with this error!!
1
2
3
4
5
6
7
8
9
10
11
12
13
  constructor in .cpp:
   test :: test(int number){
this.m_number = number
 i = new int*[m_number]
for(int j =0;j<m_number;j++)
i[j] = new int[m_number];
}
destructor in cpp:
 test :: ~test(){
for(int j =0;j<m_number;j++)
delete[] i[j];
}
delete [] i;
Show declaration of your class and everything you do with std::string member. Potentially this error might happen if there is undefined behavior involving this string.
Topic archived. No new replies allowed.