Fix a use-after-free issue, change a non-nullable pointer argument to a reference and get rid of an unused function argument.
Fix a use-after-free issue, change a non-nullable pointer argument to a reference and get rid of an unused function argument.
