Esempio n. 1
0
TCopyParamList::~TCopyParamList()
{
  Clear();
  SAFE_DESTROY(FCopyParams);
  SAFE_DESTROY(FRules);
  SAFE_DESTROY(FNames);
  SAFE_DESTROY(FNameList);
}
Esempio n. 2
0
 ~TSessionActionRecord()
 {
   SAFE_DESTROY(FErrorMessages);
   SAFE_DESTROY(FNames);
   SAFE_DESTROY(FValues);
   SAFE_DESTROY(FFileList);
   SAFE_DESTROY(FFile);
 }
Esempio n. 3
0
 void Restart()
 {
   FState = Opened;
   FRecursive = false;
   SAFE_DESTROY(FErrorMessages);
   SAFE_DESTROY(FFileList);
   SAFE_DESTROY(FFile);
   FNames->Clear();
   FValues->Clear();
 }
Esempio n. 4
0
void  twilight_path_destroy(TwilightPath *pTwilightPath)
{

   if (pTwilightPath != 0)
   {
      SAFE_DESTROY(gpath, pTwilightPath->pPath);
      SAFE_DESTROY(gbitmap, pTwilightPath->pBmpGrey);

      free(pTwilightPath);
   }

   return;

}  /* end of twilight_path_destroy */
Esempio n. 5
0
TActionLog::~TActionLog()
{
  DebugAssert(FPendingActions->GetCount() == 0);
  SAFE_DESTROY(FPendingActions);
  FClosed = true;
  ReflectSettings();
  DebugAssert(FLogger == nullptr);
}
Esempio n. 6
0
 void File(TRemoteFile * AFile)
 {
   if (FFile != nullptr)
   {
     SAFE_DESTROY(FFile);
   }
   FFile = AFile->Duplicate(true);
 }
Esempio n. 7
0
void TCopyParamList::Change(intptr_t Index, const UnicodeString & Name,
  TCopyParamType * CopyParam, TCopyParamRule * Rule)
{
  if ((Name != GetName(Index)) || !CompareItem(Index, CopyParam, Rule))
  {
    FNames->SetString(Index, Name);
    delete GetCopyParam(Index);
    FCopyParams->SetItem(Index, CopyParam);
    delete GetRule(Index);
    FRules->SetItem(Index, Rule);
    Modify();
  }
  else
  {
    SAFE_DESTROY(CopyParam);
    SAFE_DESTROY(Rule);
  }
}
Esempio n. 8
0
void DeleteConfiguration()
{
  static bool ConfigurationDeleted = false;
  if (!ConfigurationDeleted)
  {
    TConfiguration * Conf = GetConfiguration();
    SAFE_DESTROY(Conf);
    ConfigurationDeleted = true;
  }
}
Esempio n. 9
0
long reg_close_winscp_key(HKEY Key)
{
  assert(GetConfiguration() != nullptr);

  THierarchicalStorage * Storage = reinterpret_cast<THierarchicalStorage *>(Key);
  if (Storage != nullptr)
  {
    SAFE_DESTROY(Storage);
  }

  return ERROR_SUCCESS;
}
Esempio n. 10
0
//---------------------------------------------------------------------------
BOOL DllProcessDetach()
{
  assert(Processes);
  Processes--;
  if (!Processes)
  {
    assert(FarPlugin);
    SAFE_DESTROY(FarPlugin);
    TermExtensionModule();
  }
  return TRUE;
}
Esempio n. 11
0
void ResourceManager::Destroy()
{
    SAFE_DESTROY(s_playerSprite);
    SAFE_DESTROY(s_enemyOneSprite);
    SAFE_DESTROY(s_enemyOneAltSprite);
    SAFE_DESTROY(s_enemyTwoSprite);
    SAFE_DESTROY(s_enemyTwoAltSprite);
    SAFE_DESTROY(s_rocketSprite);
    SAFE_DESTROY(s_bombSprite);
}
Esempio n. 12
0
//---------------------------------------------------------------------
__fastcall TLocationProfilesDialog::~TLocationProfilesDialog()
{
  SAFE_DESTROY(FSharedScrollOnDragOver);
  SAFE_DESTROY(FSessionScrollOnDragOver);
  SAFE_DESTROY(FSharedBookmarkList);
  SAFE_DESTROY(FSessionBookmarkList);
  SAFE_DESTROY(FSharedFolders);
  SAFE_DESTROY(FSessionFolders);
}
Esempio n. 13
0
void ExtException::AddMoreMessages(const Exception * E)
{
  if (E != nullptr)
  {
    if (FMoreMessages == nullptr)
    {
      FMoreMessages = new TStringList();
    }

    const ExtException * ExtE = dyn_cast<ExtException>(E);
    if (ExtE != nullptr)
    {
      if (ExtE->GetMoreMessages() != nullptr)
      {
        FMoreMessages->Assign(ExtE->GetMoreMessages());
      }
    }

    UnicodeString Msg;
    ExceptionMessageFormatted(E, Msg);

    // new exception does not have own message, this is in fact duplication of
    // the exception data, but the exception class may being changed
    if (Message.IsEmpty())
    {
      Message = Msg;
    }
    else if (!Msg.IsEmpty())
    {
      FMoreMessages->Insert(0, UnformatMessage(Msg));
    }

    if (IsInternalException(E))
    {
      AppendExceptionStackTraceAndForget(FMoreMessages);
    }

    if (FMoreMessages->GetCount() == 0)
    {
      SAFE_DESTROY(FMoreMessages);
    }
  }
}
Esempio n. 14
0
void CoreFinalize()
{
  try
  {
    GetConfiguration()->Save();
  }
  catch (Exception & E)
  {
    ShowExtendedException(&E);
  }

  NeonFinalize();
  #ifndef NO_FILEZILLA
  TFileZillaIntf::Finalize();
  #endif
  PuttyFinalize();

  SAFE_DESTROY(StoredSessions);
  DeleteConfiguration();

  CryptographyFinalize();
  WinFinalize();
}
Esempio n. 15
0
ExtException::~ExtException() noexcept
{
  SAFE_DESTROY(FMoreMessages);
  FMoreMessages = nullptr;
}
Esempio n. 16
0
TFarConfiguration::~TFarConfiguration()
{
  SAFE_DESTROY(FBookmarks);
}
Esempio n. 17
0
//---------------------------------------------------------------------------
void __fastcall TSynchronizeController::StartStop(TObject * Sender,
  bool Start, const TSynchronizeParamType & Params, const TCopyParamType & CopyParam,
  TSynchronizeOptions * Options,
  TSynchronizeAbortEvent OnAbort, TSynchronizeThreadsEvent OnSynchronizeThreads,
  TSynchronizeLog OnSynchronizeLog)
{
  if (Start)
  {
    Configuration->Usage->Inc(L"KeepUpToDates");

    try
    {
      assert(OnSynchronizeLog != NULL);
      FSynchronizeLog = OnSynchronizeLog;

      FOptions = Options;
      if (FLAGSET(Params.Options, soSynchronize) &&
          (FOnSynchronize != NULL))
      {
        FOnSynchronize(this, Params.LocalDirectory,
          Params.RemoteDirectory, CopyParam,
          Params, NULL, FOptions, true);
      }

      FCopyParam = CopyParam;
      FSynchronizeParams = Params;

      assert(OnAbort);
      FSynchronizeAbort = OnAbort;

      if (FLAGSET(FSynchronizeParams.Options, soRecurse))
      {
        SynchronizeLog(slScan,
          FMTLOAD(SYNCHRONIZE_SCAN, (FSynchronizeParams.LocalDirectory)));
      }

      FSynchronizeMonitor = new TDiscMonitor(dynamic_cast<TComponent*>(Sender));
      FSynchronizeMonitor->SubTree = false;
      TMonitorFilters Filters;
      Filters << moFilename << moLastWrite;
      if (FLAGSET(FSynchronizeParams.Options, soRecurse))
      {
        Filters << moDirName;
      }
      FSynchronizeMonitor->Filters = Filters;
      FSynchronizeMonitor->MaxDirectories = 0;
      FSynchronizeMonitor->ChangeDelay = GUIConfiguration->KeepUpToDateChangeDelay;
      FSynchronizeMonitor->OnTooManyDirectories = SynchronizeTooManyDirectories;
      FSynchronizeMonitor->OnDirectoriesChange = SynchronizeDirectoriesChange;
      FSynchronizeMonitor->OnFilter = SynchronizeFilter;
      FSynchronizeMonitor->AddDirectory(FSynchronizeParams.LocalDirectory,
        FLAGSET(FSynchronizeParams.Options, soRecurse));
      FSynchronizeMonitor->OnChange = SynchronizeChange;
      FSynchronizeMonitor->OnInvalid = SynchronizeInvalid;
      FSynchronizeMonitor->OnSynchronize = OnSynchronizeThreads;
      // get count before open to avoid thread issues
      int Directories = FSynchronizeMonitor->Directories->Count;
      FSynchronizeMonitor->Open();

      SynchronizeLog(slStart, FMTLOAD(SYNCHRONIZE_START, (Directories)));
    }
    catch(...)
    {
      SAFE_DESTROY(FSynchronizeMonitor);
      throw;
    }
  }
  else
  {
    FOptions = NULL;
    SAFE_DESTROY(FSynchronizeMonitor);
  }
}
Esempio n. 18
0
ExtException::~ExtException() noexcept
{
  SAFE_DESTROY(FMoreMessages);
}
Esempio n. 19
0
void TCopyParamList::Reset()
{
  SAFE_DESTROY(FNameList);
  FModified = false;
}
TRegistryStorage::~TRegistryStorage()
{
  SAFE_DESTROY(FRegistry);
}
THierarchicalStorage::~THierarchicalStorage()
{
  SAFE_DESTROY(FKeyHistory);
}
Esempio n. 22
0
//---------------------------------------------------------------------------
void __fastcall TTerminalManager::DestroyInstance()
{
  assert(FInstance);
  SAFE_DESTROY(FInstance);
}
Esempio n. 23
0
//---------------------------------------------------------------------------
__fastcall TBookmarks::~TBookmarks()
{
  Clear();
  SAFE_DESTROY(FBookmarkLists);
}
Esempio n. 24
0
void TCopyParamList::Modify()
{
  SAFE_DESTROY(FNameList);
  FModified = true;
}