QUOTE
inline void copy(t_source * p_ptr) throw() {
m_ptr->service_release_safe();
m_ptr = p_ptr;
m_ptr->service_add_ref_safe();
}
m_ptr->service_release_safe();
m_ptr = p_ptr;
m_ptr->service_add_ref_safe();
}
Now m_ptr is NULL at first line.
service_release_safe looks like this:
QUOTE
void service_base::service_release_safe() throw() {
if (this != NULL) service_release();
}
if (this != NULL) service_release();
}
But when it gets there the this pointer is 8, not 0.
After lots of tracking down why it doesn't happen everywhere, I found the reason the this ptr was 8 and not NULL, as explained by this simple testcase:
CODE
class t_base
{
t_uint32 a;
virtual int & myvfunc()=0;
};
class myserviceimpl : public t_base, public user_interface
{
t_uint32 hjh;
};
service_ptr_t<myserviceimpl> test1;
service_ptr_t<myserviceimpl> test2(test1);
{
t_uint32 a;
virtual int & myvfunc()=0;
};
class myserviceimpl : public t_base, public user_interface
{
t_uint32 hjh;
};
service_ptr_t<myserviceimpl> test1;
service_ptr_t<myserviceimpl> test2(test1);
Good day
