Commands and being stack allocated in view models
Posted: 27 Mar 2023, 19:45
Hello,
In the commands tutorial there is a note about stack allocating commands:
Thanks!
In the commands tutorial there is a note about stack allocating commands:
Why is it safe in this case and in what cases is it not safe?In this sample DelegateCommand is not allocated in the heap to reduce allocations as explained in the C++ Architecture Guide. This is one of those scenarios where it is safe to do so and reference counting is not needed.
Thanks!