Great. Thanks Marc!
On the bit about the Handle constructor. From a dummy users perspective we tracked down a bug today which was determined to be the adapter trying to double delete an object when being destroyed. Our confusion was caused primarily by us being stupid and trying to have the object add itself into its adapter in its constructor. Something like:
Code:
class A
{
A()
{
AdapterForA::instance()->add(this); // !!!
}
};
I guess this is ok to do but then we also tried to keep a smart pointer reference of A around as well (which was obviously baaaaad since there is no way to link them I think?). So,
Code:
AHandle theA(new A);
Anyway, our dummy-hood may have been a little less certain if we were forced to write class A like
Code:
AdapterForA::instance()->add(AHandle(this));
And it really doesn't add that much effort I think?
V/R,
Ryan