WP sometimes quits on startup (Win7)

If ‘run as administrator’ is checked, WhatPulse relaunches. Usually this works fine, but sometimes on startup the original instance takes too long to exit. Then the new instance of WP with admin rights thinks that WP is still running, so it exits too and I have to start WP manually. I noticed the problem more with v2.3 on my home PC. This is the first time I’ve had it happen with v2.4 and on my work laptop. The log looks like this:

07-05-2014 09:10:50.234 INFO "Starting WhatPulse 2.4..." 07-05-2014 09:10:50.499 DEBUG Installed CrashRpt! 07-05-2014 09:10:52.015 DEBUG Database file: "C:/Users/pharvey/AppData/Local/WhatPulse/whatpulse.db" 07-05-2014 09:10:56.412 DEBUG Database check: "ok" 07-05-2014 09:10:56.412 DEBUG Opened database in: 4397 ms 07-05-2014 09:10:56.427 DEBUG Not running WhatPulse as Administrator! :-( 07-05-2014 09:10:56.427 DEBUG Elevating client to Administrator rights! 07-05-2014 09:11:28.943 INFO "Starting WhatPulse 2.4..." 07-05-2014 09:11:28.993 DEBUG Installed CrashRpt! 07-05-2014 09:11:28.993 DEBUG QtSingleApplication::isRunning() - appIsRunning() is true! 07-05-2014 09:11:28.993 DEBUG WhatPulse is already running! Sending message to running client to bring up MainWindow and exiting this instance.

Both computers are running Windows 7 x64.

Ah yep, still happens sometimes on my home computer too:

28-05-2014 18:56:54.203 DEBUG Created database backup in 1900 ms "(31255 pages)" 28-05-2014 19:01:10.002 INFO "Starting WhatPulse 2.4..." 28-05-2014 19:01:10.472 DEBUG Installed CrashRpt! 28-05-2014 19:01:11.017 DEBUG Database file: "C:/Users/Bloopy/AppData/Local/WhatPulse/whatpulse.db" 28-05-2014 19:02:09.075 DEBUG Database check: "ok" 28-05-2014 19:02:09.075 DEBUG Opened database in: 58068 ms 28-05-2014 19:02:09.095 DEBUG Not running WhatPulse as Administrator! :-( 28-05-2014 19:02:09.095 DEBUG Elevating client to Administrator rights! 28-05-2014 19:02:12.675 INFO "Starting WhatPulse 2.4..." 28-05-2014 19:02:12.685 DEBUG Installed CrashRpt! 28-05-2014 19:02:12.695 DEBUG QtSingleApplication::isRunning() - appIsRunning() is true! 28-05-2014 19:02:12.695 DEBUG WhatPulse is already running! Sending message to running client to bring up MainWindow and exiting this instance.

Just made a few changes that will solve this for the next version.