If memory debugging enabled return error on leaks.