fix resource leak in CompilerService