Merge "Changing global variable for local variable to prevent memory leaks" into tm-qpr-dev