User Tools

Site Tools


notes:fall2024:projects:msi2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
notes:fall2024:projects:msi2 [2024/09/26 20:47] – [obtain() function] cburlingnotes:fall2024:projects:msi2 [2024/09/27 00:23] (current) – [rmlist() function] jmerri10
Line 60: Line 60:
 With the list now clear, it is time to invoke the rmlist function. This function is simple, and very similar to how rmnode works. Simply call the clearlist function, and then free the memory for which the list was occupying. The last step is to set the now empty, non-memory-occupying list to NULL and return. With the list now clear, it is time to invoke the rmlist function. This function is simple, and very similar to how rmnode works. Simply call the clearlist function, and then free the memory for which the list was occupying. The last step is to set the now empty, non-memory-occupying list to NULL and return.
  
 +It is necessary to remove the list at the end of your game loop to manage memory properly and avoid memory leaks. If you do not remove the list, memory will not be freed and any memory occupied by the nodes you’ve added to the list will accumulate and lead to memory leak/overflow. This is also why it is important to clear your list before reinitializing/resetting your game objects. Clearing unused memory is a good habit to develop!
notes/fall2024/projects/msi2.1727383621.txt.gz · Last modified: 2024/09/26 20:47 by cburling