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) {
119119 baton->busy = false ;
120120 baton->connection ->Unref ();
121121 // transfer callback to local and dispose persistent handle
122- // must be done before invoking callback because callback may set another callback into baton->callback
123122 Local<Function> cb = uni::HandleToLocal (uni::Deref (baton->callback ));
124123 baton->callback .Dispose ();
125124 baton->callback .Clear ();
126125
127126 Handle<Value> argv[2 ];
128127 Connection::handleResult (baton, argv);
129- node::MakeCallback (Context::GetCurrent ()->Global (), cb, 2 , argv);
130-
128+
131129 baton->ResetRows ();
132130 if (baton->done || baton->error ) {
133131 // free occi resources so that we don't run out of cursors if gc is not fast enough
134132 // reader destructor will delete the baton and everything else.
135133 baton->ResetStatement ();
136134 }
137135 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);
138139}
139140
You can’t perform that action at this time.
0 commit comments