According to the law, if your I-485 is pending, and you leave USA, it means that you abandon your AOS automatically. So be careful! You had better apply for an AP before you go abroad.