Weak limits of Palais-Smale sequences for a class of critical functionals