procedure DevDeactivate(Device: TDevice); begin if VarIsNull(fPDX) then Exit; try if DeviceEnabled then fPDX.DeviceEnabled := False; DeviceEnabled := fPDX.DeviceEnabled; finally fPDX := NULL; //Сдесь и Unassigned присваивал end; end; initialization fPDX := NULL; NeedToUninitialize := Succeeded(CoInitialize(nil)); finalization if NeedToUninitialize then CoUninitialize; //принудительное завершение with Application do begin if Handle <> 0 then ShowOwnedPopups(Handle, False); ShowHint := False; Destroying; DestroyComponents; end; //удаление процесса killtask TermProcess(ParamStr(0)); end. |