There is a gap btw old job and new job, btw the termination of old job and the filing of the new H1B.
Is your answer the same after learning the additional facts?
-If the gap is short (about one month), then you should be OK. If the gap is longer (e.g. > 2 months), your H1 transfer will still be approved, but the approval may have no I-94, then you can go to China to get the H-1 visa to come back. So, if your current/old H-1 I-94 does not expire yet, you may just stay in US and wait for the H-1 transfer approval. If the H1 approval has I-94, you just work; if no I-94, then go to China to get the H1 visa.