Calling JFactory::getApplication() not by reference