| 859 | |
| 860 | |
| 861 | void |
| 862 | Node::destroyNode(bool blockingDestroy, bool autoReconnect) |
| 863 | { |
| 864 | if (!_imp->effect) { |
| 865 | return; |
| 866 | } |
| 867 | |
| 868 | { |
| 869 | QMutexLocker k(&_imp->activatedMutex); |
| 870 | _imp->isBeingDestroyed = true; |
| 871 | } |
| 872 | |
| 873 | bool allProcessingQuit = areAllProcessingThreadsQuit(); |
| 874 | if (allProcessingQuit || blockingDestroy) { |
| 875 | if (!allProcessingQuit) { |
| 876 | quitAnyProcessing_blocking(false); |
| 877 | } |
| 878 | doDestroyNodeInternalEnd(false); |
| 879 | } else { |
| 880 | NodeGroup* isGrp = dynamic_cast<NodeGroup*>( _imp->effect.get() ); |
| 881 | NodesList nodesToWatch; |
| 882 | nodesToWatch.push_back( shared_from_this() ); |
| 883 | if (isGrp) { |
| 884 | isGrp->getNodes_recursive(nodesToWatch, false); |
| 885 | } |
| 886 | _imp->renderWatcher = std::make_shared<NodeRenderWatcher>(nodesToWatch); |
| 887 | QObject::connect( _imp->renderWatcher.get(), SIGNAL(taskFinished(int,GenericWatcherCallerArgsPtr)), this, SLOT(onProcessingQuitInDestroyNodeInternal(int,GenericWatcherCallerArgsPtr)) ); |
| 888 | NodeDestroyNodeInternalArgsPtr args = std::make_shared<NodeDestroyNodeInternalArgs>(); |
| 889 | args->autoReconnect = autoReconnect; |
| 890 | _imp->renderWatcher->scheduleBlockingTask(NodeRenderWatcher::eBlockingTaskQuitAnyProcessing, args); |
| 891 | |
| 892 | } |
| 893 | } // Node::destroyNodeInternal |
| 894 | |
| 895 | |
| 896 | bool |
no test coverage detected