As JabXPCOM is built upon jabberoo, it has to take jabberoo's memory management rules into account.
This isn't any problem at all for non-const elements. But some special care has to be taken for (references to) const elements which are passed to callback functions, because these const elements are managed by jabberoo and are deleted when the callback function returns. But as these elements are wrapped inside XPCOM objects and a callback function might store a reference to an XPCOM object, the jabberoo object has to be copied in this case.
Technically, the callback function wrapper checks if any references to the XPCOM object are still held and calls the detach method of the XPCOM wrapper which then takes care of making a local copy of the jabberoo object.
