hrsakai commented on a change in pull request #153:
URL: https://github.com/apache/pulsar-client-node/pull/153#discussion_r634050519



##########
File path: src/Reader.cc
##########
@@ -66,33 +105,41 @@ class ReaderNewInstanceWorker : public Napi::AsyncWorker {
 
     pulsar_result result =
         pulsar_client_create_reader(this->cClient, topic.c_str(), 
this->readerConfig->GetCStartMessageId(),
-                                    this->readerConfig->GetCReaderConfig(), 
&(this->cReader));
-    delete this->readerConfig;
+                                    this->readerConfig->GetCReaderConfig(), 
&this->readerWrapper->cReader);
     if (result != pulsar_result_Ok) {
       SetError(std::string("Failed to create reader: ") + 
pulsar_result_str(result));
       return;
+    } else {
+      this->listener = this->readerConfig->GetListenerCallback();
     }
+    delete this->readerConfig;

Review comment:
       I think it is better to write as follows.
   
https://github.com/apache/pulsar-client-node/blob/v1.3.0/src/Consumer.cc#L180-L187




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to