On methods of storing arrays of text

I wonder if this is a good way to do this. It clearly works, but I don't fully understand how. One post suggested adding the last line to prevent heap memory problem. How would I test for such a problem? Could some gurus please offer some advice?.
Ideally I would like to store the text array in flash and access it the same way. Any pointers would be welcome.

void test()
{
  
  char* array[] = {"text1", "text2", "text3", "text4"};

code
.
.
.
code

   var1=array[2];  // use the array
Serial1.print(var1);  //prints text1

  delete[]array;  // IS THIS LINE NEEDED?
}