So the copy constructor you are using might produce problems which could cause the memory leaks. We have to clean this up before we can merge.

Have a look into the copy constructor and check

 * which parts are done copy by value rather than copy by reference/pointer
 * which parts are shared between the two objects (is SG_REF done properly?)
 * whether everything is initialised properly