07-08-2013 01:55 PM
Hey everyone. I'm seeing some strange behavior, somewhat related to an old question of mine.
My app is maybe 4-5000 lines total, with a dozen control arrays, and maybe 100-150 controls. So it's not gigantic, but it's fairly good sized.
Oddity: I'm seeing some very long application shutdown times. That is, when I close the app with an exit button control, or from the app's Windows titlebar "X" icon, or from the menu, I can step through the process and I see several of the callbacks get called spuriously. I believe that since these callbacks are getting called "one last time", it's probably adding up to the observed 13-14 seconds of shutdown time!
In the other post above, there was talk about including the "default: return 0;" case. I like that and have included in all my major state machine timers. Yet I'm still unable to shut down the app immediately.
Another observation: if I breakpoint right on the CloseCVIRTE line, I'm seeing a near zero time delay between clicking Close and this line. It's after the CloseCVIRTE that the program hangs for 13 seconds. And this portion isn't traceable.
My main loop skeleton:
int main (int argc, char *argv[]) { if (InitCVIRTE (0, argv, 0) == 0) return -1; // out of memory error if (mainPanel < 0) return -1; // out of memory error // display the GUI DisplayPanel(mainPanel); RunUserInterface(); // close the GUI DiscardPanel(mainPanel); CloseCVIRTE(); return 0; }
Ideas?
Solved! Go to Solution.
07-08-2013 05:42 PM
No real idea. I have observed myself this same phenomenon, shorter in time but indeed notable, and noted that if I explicity free all allocated resources exit time is a little bit faster. With that I mean: