Calling a function that triggers a UI refresh after removing comments via a script may access an invalidated object, leading to program crashes.