fixed a potential native peer memory leak