dispose method

void dispose()

Disposes the allocated memory for the string.

Implementation

void dispose() {
  if (data != nullptr) {
    calloc.free(data);
    data = nullptr;
  }
}