MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / ~AppManager

Method ~AppManager

Engine/AppManager.cpp:432–492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

430}
431
432AppManager::~AppManager()
433{
434#ifdef NATRON_USE_BREAKPAD
435 if (_imp->breakpadAliveThread) {
436 _imp->breakpadAliveThread->quitThread();
437 }
438#endif
439
440 bool appsEmpty;
441 {
442 QMutexLocker k(&_imp->_appInstancesMutex);
443 appsEmpty = _imp->_appInstances.empty();
444 }
445 while (!appsEmpty) {
446 AppInstancePtr front;
447 {
448 QMutexLocker k(&_imp->_appInstancesMutex);
449 front = _imp->_appInstances.front();
450 }
451 if (front) {
452 front->quitNow();
453 }
454 {
455 QMutexLocker k(&_imp->_appInstancesMutex);
456 appsEmpty = _imp->_appInstances.empty();
457 }
458 }
459
460 for (PluginsMap::iterator it = _imp->_plugins.begin(); it != _imp->_plugins.end(); ++it) {
461 for (PluginVersionsOrdered::reverse_iterator itver = it->second.rbegin(); itver != it->second.rend(); ++itver) {
462 delete *itver;
463 }
464 }
465
466 _imp->_backgroundIPC.reset();
467
468 try {
469 _imp->saveCaches();
470 } catch (std::runtime_error&) {
471 // ignore errors
472 }
473
474 ///Caches may have launched some threads to delete images, wait for them to be done
475 QThreadPool::globalInstance()->waitForDone();
476
477 ///Kill caches now because decreaseNCacheFilesOpened can be called
478 _imp->_nodeCache->waitForDeleterThread();
479 _imp->_diskCache->waitForDeleterThread();
480 _imp->_viewerCache->waitForDeleterThread();
481 _imp->_nodeCache.reset();
482 _imp->_viewerCache.reset();
483 _imp->_diskCache.reset();
484
485 tearDownPython();
486 _imp->tearDownGL();
487
488 _instance = 0;
489

Callers

nothing calls this directly

Calls 9

emptyMethod · 0.80
waitForDeleterThreadMethod · 0.80
tearDownGLMethod · 0.80
quitThreadMethod · 0.45
quitNowMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
resetMethod · 0.45
saveCachesMethod · 0.45

Tested by

no test coverage detected