Closed GiPe66 closed 1 year ago
bool ATConnection::parseNotification() noexcept { auto pos = buffer.indexOf('\n'); if (pos < 0) { return false; } ATNotificationEvent event(buffer.substring(0, pos - 1)); this->emit(&event); buffer.remove(0, pos + 1); return true; }
buffer.substring is a temporary object and the reference to it is lost.
Hi @GiPe66 I Fixed this and just released a new version (v0.2.1). Thank you for your contribution. If you encounter any other problems please don't hesitate to report it.
bool ATConnection::parseNotification() noexcept { auto pos = buffer.indexOf('\n'); if (pos < 0) { return false; } ATNotificationEvent event(buffer.substring(0, pos - 1)); this->emit(&event); buffer.remove(0, pos + 1); return true; }
buffer.substring is a temporary object and the reference to it is lost.