Match the BeginFrame with an EndFrame to avoid leaking memory and asserting.
Merge pull request #3235 from fluffyfreak/mismatch_frame

Match the BeginFrame with an EndFrame.