Skip to content

Commit

Permalink
THRIFT-4225: Delete callback if RPC send failed
Browse files Browse the repository at this point in the history
  • Loading branch information
bforbis authored and jeking3 committed Jun 27, 2018
1 parent af7ecd6 commit d7b635f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler/cpp/src/thrift/generate/t_js_generator.cc
Expand Up @@ -1613,10 +1613,11 @@ void t_js_generator::generate_service_client(t_service* tservice) {
indent_down();
f_service_ << indent() << "}" << endl;

// Reset the transport if there was a serialization error
// Reset the transport and delete registered callback if there was a serialization error
f_service_ << indent() << "catch (e) {" << endl;
indent_up();
if (gen_node_) {
f_service_ << indent() << "delete this._reqs[this.seqid()];" << endl;
f_service_ << indent() << "if (typeof " << outputVar << ".reset === 'function') {" << endl;
f_service_ << indent() << " " << outputVar << ".reset();" << endl;
f_service_ << indent() << "}" << endl;
Expand Down

0 comments on commit d7b635f

Please sign in to comment.