Commit 15fcc695 authored by Ghislain MARY's avatar Ghislain MARY

Fix some memory leaks.

parent 894391c1
...@@ -136,11 +136,11 @@ private: ...@@ -136,11 +136,11 @@ private:
std::list<Content > contents; std::list<Content > contents;
Content internalContent; Content internalContent;
std::unordered_map<std::string, std::string> customHeaders; std::unordered_map<std::string, std::string> customHeaders;
mutable LinphoneErrorInfo * errorInfo = NULL; mutable LinphoneErrorInfo * errorInfo = nullptr;
belle_http_request_t *httpRequest = NULL; belle_http_request_t *httpRequest = nullptr;
belle_http_request_listener_t *httpListener = NULL; belle_http_request_listener_t *httpListener = nullptr;
SalOp *salOp = NULL; SalOp *salOp = nullptr;
SalCustomHeader *salCustomHeaders = NULL; SalCustomHeader *salCustomHeaders = nullptr;
unsigned long backgroundTaskId; unsigned long backgroundTaskId;
unsigned char currentSendStep = Step::None; unsigned char currentSendStep = Step::None;
bool applyModifiers = true; bool applyModifiers = true;
...@@ -148,7 +148,7 @@ private: ...@@ -148,7 +148,7 @@ private:
ContentType cContentType; ContentType cContentType;
std::string cText; std::string cText;
// Used for compatibility with previous C API // Used for compatibility with previous C API
LinphoneContent *cFileTransferInformation = NULL; LinphoneContent *cFileTransferInformation = nullptr;
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
......
...@@ -51,7 +51,10 @@ ChatMessagePrivate::ChatMessagePrivate (const shared_ptr<ChatRoom> &room) ...@@ -51,7 +51,10 @@ ChatMessagePrivate::ChatMessagePrivate (const shared_ptr<ChatRoom> &room)
: chatRoom(room) { : chatRoom(room) {
} }
ChatMessagePrivate::~ChatMessagePrivate () {} ChatMessagePrivate::~ChatMessagePrivate () {
if (salOp)
salOp->release();
}
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
......
...@@ -266,9 +266,12 @@ void IsComposing::stopAllRemoteRefreshTimers () { ...@@ -266,9 +266,12 @@ void IsComposing::stopAllRemoteRefreshTimers () {
} }
unordered_map<string, belle_sip_source_t *>::iterator IsComposing::stopRemoteRefreshTimer (const unordered_map<string, belle_sip_source_t *>::const_iterator it) { unordered_map<string, belle_sip_source_t *>::iterator IsComposing::stopRemoteRefreshTimer (const unordered_map<string, belle_sip_source_t *>::const_iterator it) {
if (core && core->sal) belle_sip_source_t *timer = it->second;
core->sal->cancel_timer(it->second); if (core && core->sal) {
belle_sip_object_unref(it->second); core->sal->cancel_timer(timer);
delete reinterpret_cast<IsRemoteComposingData *>(belle_sip_source_get_user_data(timer));
}
belle_sip_object_unref(timer);
return remoteRefreshTimers.erase(it); return remoteRefreshTimers.erase(it);
} }
......
...@@ -39,7 +39,6 @@ static void doNotify (const string &notify, LinphoneEvent *lev) { ...@@ -39,7 +39,6 @@ static void doNotify (const string &notify, LinphoneEvent *lev) {
linphone_content_set_buffer(content, notify.c_str(), strlen(notify.c_str())); linphone_content_set_buffer(content, notify.c_str(), strlen(notify.c_str()));
linphone_event_notify(lev, content); linphone_event_notify(lev, content);
linphone_content_unref(content); linphone_content_unref(content);
linphone_event_unref(lev);
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment