colada dom 1.2 and memory leak

I made an importer from collada collada 1.4 with collada dom 1.2.
The problem is that I can not free the resources correctly and i get the memory leak.
These memory leaks are fixed by using a more recent version of collada dom?
which version do you recommend?
How do you release the resources properly?
Can you post me the 3 lines of code for free memory?

collada dom 2.2 is back compatible with the dom 1.2 ?