jezhiggins/arabica — pull request #10 by QuentinFiard (2014-02-28 01:47:39+00:00)
Title: Quick and dirty fix to allow the unit tests to pass

##### Warning: with C++11 you may need https://github.com/jezhiggins/arabica/pull/9 as well to compile Arabica

### Issue description

As is, the DocumentImpl object is deleted at the end of the call to appendChild (DOMImplementation.hpp:73) as its reference count follows the pattern:
- 0 (after line 70)
- 1 inside appendChild (the child calls addRef on it)
- 0 when we exit appendChild, which causes the object to be deleted.

This is a quick and dirty fix to allow the unit tests to pass. I am however unsure this should be used in production code as I have not encountered this problem otherwise. I would appreciate if someone could take a look and figure out if this is actually needed all the time or if we should maybe define another method for use in the unit tests.