src,sqlite: fix filterFunc dangling reference

PR-URL: https://github.com/nodejs/node/pull/62281
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Edy Silva authored and Antoine du Hamel committed 2026-03-30 17:20:25 +02:00
1 parent b800c57fce
commit ede52bc2dc
1 file changed
+2 -1
+2 -1
View File
@@ -2157,7 +2157,8 @@ void DatabaseSync::ApplyChangeset(const FunctionCallbackInfo<Value>& args) {
Local<Function> filterFunc = filterValue.As<Function>();
context.filterCallback = [&](std::string_view item) -> bool {
context.filterCallback =
[env, db, filterFunc](std::string_view item) -> bool {
// If there was an error in the previous call to the filter's
// callback, we skip calling it again.
if (db->ignore_next_sqlite_error_) {