buffer_delete

This function deletes a buffer previously created using buffer_create from memory, releasing the resources used to create it and removing any data that it may currently contain.

NOTE It's important to always remove any dynamically created resources from memory when you no longer need them to prevent memory leaks.

IMPORTANT When you create a buffer, a reference to the new buffer is returned. After the buffer is destroyed, we recommend that you set the variable that holds a buffer reference to -1.

 

Syntax:

buffer_delete(buffer)

ArgumentTypeDescription
bufferBufferThe buffer to delete.

 

Returns:

N/A

 

Example:

buffer_delete(player_buffer);
player_buffer = -1;

The above code deletes the buffer stored in the variable player_buffer and then sets the variable to -1.