Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. Restart Application not immediatly

Restart Application not immediatly

Scheduled Pinned Locked Moved Unsolved QtWebEngine
8 Posts 4 Posters 774 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Belfix
    wrote on last edited by
    #1

    Hi,
    my application delete some files at startup... if i restart my app with "startDetached" the files are not deleted by the new process because the "old process" locks it...
    Can you help me please?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Then delete your files before doing the restart.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • B Offline
        B Offline
        Belfix
        wrote on last edited by
        #3

        It cant be done... they are locked by the Qt App... the folder is the local storage.

        C:\Users\xxx\AppData\Local\QSEM\QSEM\QtWebEngine\Default\Local Storage\leveldb

        I don't know how to delete it...

        JonBJ 1 Reply Last reply
        0
        • B Belfix

          It cant be done... they are locked by the Qt App... the folder is the local storage.

          C:\Users\xxx\AppData\Local\QSEM\QSEM\QtWebEngine\Default\Local Storage\leveldb

          I don't know how to delete it...

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @Belfix
          Yes, it can be difficult/not possible to delete files which are presently open/locked in an application.

          if i restart my app with "startDetached" the files are not deleted by the new process because the "old process" locks it...

          Do you exit the "old process" immediately after the startDetached() call? startDetached() does not "restart" the calling application, it starts a new process independently.

          If both the old and the new processes store stuff in/lock ...\Local Storage\leveldb I don't see how you are going to delete things there.

          1 Reply Last reply
          0
          • B Offline
            B Offline
            Belfix
            wrote on last edited by
            #5

            The startDetached is called after the application exit with code (-1)

            jsulmJ 1 Reply Last reply
            0
            • B Belfix

              The startDetached is called after the application exit with code (-1)

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Belfix said in Restart Application not immediatly:

              The startDetached is called after the application exit with code (-1)

              I doubt this is going to work.
              I would rather start a batch script which first waits a bit and then starts the app. After starting that script via startDetached you can normally exit your app.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              B 1 Reply Last reply
              0
              • jsulmJ jsulm

                @Belfix said in Restart Application not immediatly:

                The startDetached is called after the application exit with code (-1)

                I doubt this is going to work.
                I would rather start a batch script which first waits a bit and then starts the app. After starting that script via startDetached you can normally exit your app.

                B Offline
                B Offline
                Belfix
                wrote on last edited by
                #7

                @jsulm I put a QThread::sleep(5) at application startup... it could be the same?

                jsulmJ 1 Reply Last reply
                0
                • B Belfix

                  @jsulm I put a QThread::sleep(5) at application startup... it could be the same?

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @Belfix said in Restart Application not immediatly:

                  it could be the same?

                  Could be

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved