Skip to content

Commit 40c625b

Browse files
authored
src,sqlite: fix filterFunc dangling reference
PR-URL: #62281 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 27501b4 commit 40c625b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/node_sqlite.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2157,7 +2157,8 @@ void DatabaseSync::ApplyChangeset(const FunctionCallbackInfo<Value>& args) {
21572157

21582158
Local<Function> filterFunc = filterValue.As<Function>();
21592159

2160-
context.filterCallback = [&](std::string_view item) -> bool {
2160+
context.filterCallback =
2161+
[env, db, filterFunc](std::string_view item) -> bool {
21612162
// If there was an error in the previous call to the filter's
21622163
// callback, we skip calling it again.
21632164
if (db->ignore_next_sqlite_error_) {

0 commit comments

Comments
 (0)