[Core] Fix memory leak in ProjectService