Fix the crash when it tries to destroy the wrong surface