ASAN TFD289
Change-Id: I8261058c690244e6a21df616c67dae5dda1117ff
for (auto it = m_observers.begin(); it != m_observers.end(); ++it)
(*it)->update(uri, msg);
- if (msg->ref_count() == 0)
- msg->unref();
+ if (msg->ref_count() == 0) {
+ delete msg;
+ msg = NULL;
+ }
set_cache(data, len);
if (!m_ch->send_sync(m_msg))
return false;
- if (m_msg)
+ if (m_msg) {
m_msg->unref();
+ if(m_msg->ref_count() <= 0) {
+ delete m_msg;
+ m_msg = NULL;
+ }
+ }
return false;
}
message::~message()
{
- if (m_msg && ref_cnt == 0) {
+ if (m_msg) {
delete [] m_msg;
m_msg = NULL;
}
{
ref_cnt--;
- if (ref_cnt > 0 || !m_msg)
+ /*if (ref_cnt > 0 || !m_msg)
return;
delete [] m_msg;
m_msg = NULL;
- delete this;
+ delete this;*/
}
int message::ref_count(void)