Qt Code:
  1. try
  2. {
  3. char *testarr = new char[15];
  4. QString strVal1="Test";
  5. QByteArray br = strVal1.toUtf8();
  6. testarr = br.data();
  7.  
  8.  
  9. delete[] testarr; //Why my application crashes here.
  10. }
  11. catch(...)
  12. {
  13. QMessageBox::information(0, "", "Error");
  14. }
To copy to clipboard, switch view to plain text mode 

I have two questions

1) Why my above program crashes when I call delete[] testarr; ?
2) Why the catch block doesnot hadle that exception ?

I am using Qt creator 4.8 in ubuntu OS