k2la commented on a change in pull request #153: URL: https://github.com/apache/pulsar-client-node/pull/153#discussion_r634037831
########## 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: Exactly. If the result is not ok, this is not be executed. I fixed that this is be done if the result is not ok. -- 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