Skip to content

Commit 48fc045

Browse files
committed
Capture funcs by ref in lambda
1 parent 9f0f50a commit 48fc045

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/node_sqlite.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2279,7 +2279,7 @@ void DatabaseSync::ApplyChangeset(const FunctionCallbackInfo<Value>& args) {
22792279
return;
22802280
}
22812281
conflictFunc = conflictValue.As<Function>();
2282-
context.conflictCallback = [env, conflictFunc](int conflictType) -> int {
2282+
context.conflictCallback = [env, &conflictFunc](int conflictType) -> int {
22832283
Local<Value> argv[] = {Integer::New(env->isolate(), conflictType)};
22842284
TryCatch try_catch(env->isolate());
22852285
Local<Value> result =
@@ -2318,7 +2318,7 @@ void DatabaseSync::ApplyChangeset(const FunctionCallbackInfo<Value>& args) {
23182318
filterFunc = filterValue.As<Function>();
23192319

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

0 commit comments

Comments
 (0)