File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -119,21 +119,22 @@ void Reader::EIO_AfterNextRows(uv_work_t* req, int status) {
119
119
baton->busy = false ;
120
120
baton->connection ->Unref ();
121
121
// transfer callback to local and dispose persistent handle
122
- // must be done before invoking callback because callback may set another callback into baton->callback
123
122
Local<Function> cb = uni::HandleToLocal (uni::Deref (baton->callback ));
124
123
baton->callback .Dispose ();
125
124
baton->callback .Clear ();
126
125
127
126
Handle<Value> argv[2 ];
128
127
Connection::handleResult (baton, argv);
129
- node::MakeCallback (Context::GetCurrent ()->Global (), cb, 2 , argv);
130
-
128
+
131
129
baton->ResetRows ();
132
130
if (baton->done || baton->error ) {
133
131
// free occi resources so that we don't run out of cursors if gc is not fast enough
134
132
// reader destructor will delete the baton and everything else.
135
133
baton->ResetStatement ();
136
134
}
137
135
delete req;
136
+
137
+ // invoke callback at the very end because callback may re-enter nextRows.
138
+ node::MakeCallback (Context::GetCurrent ()->Global (), cb, 2 , argv);
138
139
}
139
140
You can’t perform that action at this time.
0 commit comments