We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8f046ea commit 5de5935Copy full SHA for 5de5935
src/producer.cc
@@ -629,6 +629,17 @@ NAN_METHOD(Producer::NodeProduce) {
629
error_code = static_cast<int>(b.err());
630
}
631
632
+ if (error_code != 0 && opaque) {
633
+ // If there was an error enqueing this message, there will never
634
+ // be a delivery report for it, so we have to clean up the opaque
635
+ // data now, if there was any.
636
+
637
+ Nan::Persistent<v8::Value> *persistent =
638
+ static_cast<Nan::Persistent<v8::Value> *>(opaque);
639
+ persistent->Reset();
640
+ delete persistent;
641
+ }
642
643
if (key != NULL) {
644
delete key;
645
0 commit comments