Wie wäre es, wenn due es so in der Art machst:
Delphi-Quellcode:
uses Shutdown, ConfigForm;
procedure TMainForm.Beenden;
var
ShutdownObj: TShutdown;
begin
ShutdownObj := TShutdown.Create;
try
case config_frm.ShutdownSelect.ItemIndex of
0: Close;
1: ShutdownObj.Shutdown (...);
2: ...
end;
finally
FreeAndNil (ShutdownObj);
end;
end;