ds_priority_destroy

Destroys a given priority queue and removes it from memory.

Syntax:

GML Code Example

ds_priority_destroy(id);


Argument Description
id The id of the data structure to remove.


Returns: N/A


Description

This function will remove the given priority queue data-structure from memory, freeing up the resources it was using and removing all values that it contained. This function should always be used when you are finished using the ds_priority queue to prevent memory leaks that can slow down and crash your game.


Example:

GML Code Example

if lives = 0
    {
    ds_priority_destroy(AI_queue);
    room_goto(rm_Menu);
    }
 

The above code will check the value of the built in global variable "lives" and if it is 0, it destroys the ds_queue indexed in the variable "AI_queue" and then changes rooms.





No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here