diff --git a/src/chat/chat-message/chat-message-p.h b/src/chat/chat-message/chat-message-p.h index accd87b3c..1618639fe 100644 --- a/src/chat/chat-message/chat-message-p.h +++ b/src/chat/chat-message/chat-message-p.h @@ -136,11 +136,11 @@ private: std::list contents; Content internalContent; std::unordered_map customHeaders; - mutable LinphoneErrorInfo * errorInfo = NULL; - belle_http_request_t *httpRequest = NULL; - belle_http_request_listener_t *httpListener = NULL; - SalOp *salOp = NULL; - SalCustomHeader *salCustomHeaders = NULL; + mutable LinphoneErrorInfo * errorInfo = nullptr; + belle_http_request_t *httpRequest = nullptr; + belle_http_request_listener_t *httpListener = nullptr; + SalOp *salOp = nullptr; + SalCustomHeader *salCustomHeaders = nullptr; unsigned long backgroundTaskId; unsigned char currentSendStep = Step::None; bool applyModifiers = true; @@ -148,7 +148,7 @@ private: ContentType cContentType; std::string cText; // Used for compatibility with previous C API - LinphoneContent *cFileTransferInformation = NULL; + LinphoneContent *cFileTransferInformation = nullptr; // ----------------------------------------------------------------------------- diff --git a/src/chat/chat-message/chat-message.cpp b/src/chat/chat-message/chat-message.cpp index ebcf0e8c8..ed813723d 100644 --- a/src/chat/chat-message/chat-message.cpp +++ b/src/chat/chat-message/chat-message.cpp @@ -51,7 +51,10 @@ ChatMessagePrivate::ChatMessagePrivate (const shared_ptr &room) : chatRoom(room) { } -ChatMessagePrivate::~ChatMessagePrivate () {} +ChatMessagePrivate::~ChatMessagePrivate () { + if (salOp) + salOp->release(); +} // ----------------------------------------------------------------------------- diff --git a/src/chat/notification/is-composing.cpp b/src/chat/notification/is-composing.cpp index dd2a935a7..ed2424b3e 100644 --- a/src/chat/notification/is-composing.cpp +++ b/src/chat/notification/is-composing.cpp @@ -266,9 +266,12 @@ void IsComposing::stopAllRemoteRefreshTimers () { } unordered_map::iterator IsComposing::stopRemoteRefreshTimer (const unordered_map::const_iterator it) { - if (core && core->sal) - core->sal->cancel_timer(it->second); - belle_sip_object_unref(it->second); + belle_sip_source_t *timer = it->second; + if (core && core->sal) { + core->sal->cancel_timer(timer); + delete reinterpret_cast(belle_sip_source_get_user_data(timer)); + } + belle_sip_object_unref(timer); return remoteRefreshTimers.erase(it); } diff --git a/src/conference/local-conference-event-handler.cpp b/src/conference/local-conference-event-handler.cpp index 272cde56a..ec6a0cd0c 100644 --- a/src/conference/local-conference-event-handler.cpp +++ b/src/conference/local-conference-event-handler.cpp @@ -39,7 +39,6 @@ static void doNotify (const string ¬ify, LinphoneEvent *lev) { linphone_content_set_buffer(content, notify.c_str(), strlen(notify.c_str())); linphone_event_notify(lev, content); linphone_content_unref(content); - linphone_event_unref(lev); } // -----------------------------------------------------------------------------