Deleting terrain splatmap through scripts.

Is there a way to delete/remove the Unity terrain’s splat-map data through scripts?

I am using C# to write an automated terrain generator for my game,
currently working on auto-splatmapping part of the system.

I have successfully created splatmaps using this.

But how do I remove splatmaps?
I can’t seem to find any solutions for this yet.

This is a old question but I answer it nevertheless.

I do it the following way:

  void OnApplicationQuit()
  {
    Ground.terrainData.splatPrototypes = null;
  }

Which will called when the application quits.