Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Resolved]Application in Debug mode and Release mode
Qt 6.11 is out! See what's new in the release blog

[Resolved]Application in Debug mode and Release mode

Scheduled Pinned Locked Moved General and Desktop
7 Posts 2 Posters 2.3k Views 1 Watching
  • 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.
  • I Offline
    I Offline
    Ivan1120
    wrote on last edited by
    #1

    Hello everyone, why my application ran on debug mode is successful, but when I tried to ran on release mode, my application would be in a deadlock on somewhere of my application.My operation system is Win 7 and QT tool kit is "MinGW4.8".Could someone help me, thanks~~~~

    1 Reply Last reply
    0
    • L Offline
      L Offline
      leon.anavi
      wrote on last edited by
      #2

      Could you please provide details about you application? Which version of Qt are you using?

      http://anavi.org/

      1 Reply Last reply
      0
      • I Offline
        I Offline
        Ivan1120
        wrote on last edited by
        #3

        My application seems to be stopped on one of my thread that was emitting signal to my host thread that could show something on GUI, the version of my Qt is 5.1.0.And I also found my application is not crashed, because GUI still could respond to my operation.

        1 Reply Last reply
        0
        • L Offline
          L Offline
          leon.anavi
          wrote on last edited by
          #4

          Could you please share the code of the signal and the slot that handles it? Are you sure that the apps work successfully in the same scenario in debug mode?

          http://anavi.org/

          1 Reply Last reply
          0
          • I Offline
            I Offline
            Ivan1120
            wrote on last edited by
            #5

            Yes, I absolutely confirm. Following is my a part of code.The thread is locked here.
            @
            for(int j =0; j < InverterInfoList.length(); j ++)
            {
            emit ChangeCurrentState(QString("%1").arg(j));
            if(InverterInfoList[j].isFinded == true && j == InverterInfoList[j].ModbusAddress)
            {
            jumpThisTime = true;
            break;
            }
            }
            @
            I found what's wrong with my code.If i didn't initialize my variable, in the debug mode all things are fine, but in release mode, when you use this variable, the thread would be locked.
            @
            bool jumpThisTime;
            @

            if I change my code to following

            @
            bool jumpThisTime = false;
            @

            In the release mode, all things will be ok.Is this a correct behavior??

            1 Reply Last reply
            0
            • L Offline
              L Offline
              leon.anavi
              wrote on last edited by
              #6

              [quote author="Ivan1120" date="1379299915"]
              In the release mode, all things will be ok.Is this a correct behavior??
              [/quote]

              It is mandatory to initialize all variable because otherwise the behavior of the code is unexpected.

              I can not say whether everything will be OK with your app because I am not familiar with it's logic and all of the code :) You have to carefully test the app :)

              http://anavi.org/

              1 Reply Last reply
              0
              • I Offline
                I Offline
                Ivan1120
                wrote on last edited by
                #7

                Thanks for reply : ). I'll be careful with testing the app.

                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