Patrick wrote:
Hello!
Merged. I was wondering a bit about the OBEX event leak (m_obexEvent):
The solution is to check explictly whether m_obexEvent already wraps a
resource
before assigning a new value to it.
Setting a new value for m_obexEvent, one of our cxxptr smart pointers,
will automatically free any existing resource pointed to by it. Why was
it possible to leak something owed by it?
No, the assignment operator for eptr does not release the resource it already
owns,
see:
eptr & operator = (eptr &other) {
m_pointer = other.m_pointer;
other.m_pointer = NULL;
return *this;
}
Maybe we should change it to:
eptr & operator = (eptr &other) {
set (other.m_pointer);
other.m_pointer = NULL;
return *this;
}
Best Regards,
Congwu