| 510 | typedef std::shared_ptr<QuitInstanceArgs> QuitInstanceArgsPtr; |
| 511 | |
| 512 | void |
| 513 | AppManager::afterQuitProcessingCallback(const GenericWatcherCallerArgsPtr& args) |
| 514 | { |
| 515 | QuitInstanceArgs* inArgs = dynamic_cast<QuitInstanceArgs*>( args.get() ); |
| 516 | |
| 517 | if (!inArgs) { |
| 518 | return; |
| 519 | } |
| 520 | |
| 521 | AppInstancePtr instance = inArgs->instance.lock(); |
| 522 | |
| 523 | instance->aboutToQuit(); |
| 524 | |
| 525 | appPTR->removeInstance( instance->getAppID() ); |
| 526 | |
| 527 | int nbApps = getNumInstances(); |
| 528 | ///if we exited the last instance, exit the event loop, this will make |
| 529 | /// the exec() function return. |
| 530 | if (nbApps == 0) { |
| 531 | assert(qApp); |
| 532 | qApp->quit(); |
| 533 | } |
| 534 | |
| 535 | // This should kill the AppInstance |
| 536 | instance.reset(); |
| 537 | } |
| 538 | |
| 539 | void |
| 540 | AppManager::quitNow(const AppInstancePtr& instance) |
nothing calls this directly
no test coverage detected