It's only best practice for timers or event handlers like socket or websockets etc. You are using over a variable of array data type which can also freed from memory if you don't use cleanup function.