bugfixed: memory leak on shutdown due to a non closed reference in the c++-library