Skip to content
  • Igor Kushnir's avatar
    Don't create a file in a directory before removing it recursively · fbe7067b
    Igor Kushnir authored and Milian Wolff's avatar Milian Wolff committed
    bc828ea9 removed no longer necessary
    KLockFile::Ptr m_lock from ItemRepositoryRegistry, but failed to remove
    the lockForWriting() call, which worked around an issue related to
    m_lock. From the documentation to QDir::removeRecursively():
      If a file or directory cannot be removed, removeRecursively() keeps
      going and attempts to delete as many files and sub-directories as
      possible, then returns false.
    
    Clearly, any protection offered by creating the "is_writing" file in the
    directory is unreliable because removeRecursively() may remove the newly
    created file first.
    fbe7067b