Skip to content

Commit

Permalink
Update tutorial05_answer.md
Browse files Browse the repository at this point in the history
  • Loading branch information
miloyip authored Nov 23, 2016
1 parent 360ca90 commit a5d197b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tutorial05_answer/tutorial05_answer.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ void lept_free(lept_value* v) {
## 4. 解析错误时的内存处理
遇到解析错误时,我们可能在之前已压入了一些值在自定议堆栈上。如果没有处理,最后会在 `lept_parse()` 中发现堆栈上还有一些值,做成断言失败。所以,遇到解析错误时,我们必须弹出并释放那些值。
遇到解析错误时,我们可能在之前已压入了一些值在自定义堆栈上。如果没有处理,最后会在 `lept_parse()` 中发现堆栈上还有一些值,做成断言失败。所以,遇到解析错误时,我们必须弹出并释放那些值。
在 `lept_parse_array` 中,原本遇到解析失败时,会直接返回错误码。我们把它改为 `break` 离开循环,在循环结束后的地方用 `lept_free()` 释放从堆栈弹出的值,然后才返回错误码:
Expand Down

0 comments on commit a5d197b

Please sign in to comment.