One.
Since we're speaking of Maleficent and Pete, the possible things are that they took care of the heartless by overpowering them and warp all of them to another area including themselves or they did die and fall into the pit of the floating castle.
Two.
The moon was probably another gateway to get to Kingdom Hearts itself. Like in End of the World, that door was to another door. Note, you should notice by now there are many ways to Kingdom Hearts. Like in Fullmetal Alchemist. You can preform human transmutation, transmute a baby, transmute a homonculi or human and still wind up at The Gate. Since the hearts of the lost ones or people who turned into heartless are connected still to Kingdom Hearts since they go back to it, Kingdom hearts opens for them since they go into it. Think of doing ten of the 1000 heartless battle. You'd get 10,000 hearts from just that. Nearly enough to open up Kingdom Hearts and use it's powers through a heart itself.
^That's what I think!