Skip to content

Commit

Permalink
fix(ssr): fix memory leak when vnode component render throws error
Browse files Browse the repository at this point in the history
fix #3100
  • Loading branch information
yyx990803 committed Mar 25, 2021
1 parent 2b588cf commit da944cb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/runtime-core/src/componentRenderUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import {
Comment,
cloneVNode,
VNodeArrayChildren,
isVNode
isVNode,
blockStack
} from './vnode'
import { handleError, ErrorCodes } from './errorHandling'
import { PatchFlags, ShapeFlags, isOn, isModelListener } from '@vue/shared'
Expand Down Expand Up @@ -201,6 +202,7 @@ export function renderComponentRoot(
result = root
}
} catch (err) {
blockStack.length = 0
handleError(err, instance, ErrorCodes.RENDER_FUNCTION)
result = createVNode(Comment)
}
Expand Down

0 comments on commit da944cb

Please sign in to comment.