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

Fix some memory leaks.

parent 894391c1
......@@ -136,11 +136,11 @@ private:
std::list<Content > contents;
Content internalContent;
std::unordered_map<std::string, std::string> 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;
// -----------------------------------------------------------------------------
......
......@@ -51,7 +51,10 @@ ChatMessagePrivate::ChatMessagePrivate (const shared_ptr<ChatRoom> &room)
: chatRoom(room) {
}
ChatMessagePrivate::~ChatMessagePrivate () {}
ChatMessagePrivate::~ChatMessagePrivate () {
if (salOp)
salOp->release();
}
// -----------------------------------------------------------------------------
......
......@@ -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) {
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<IsRemoteComposingData *>(belle_sip_source_get_user_data(timer));
}
belle_sip_object_unref(timer);
return remoteRefreshTimers.erase(it);
}
......
......@@ -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_event_notify(lev, 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