void SkAnimateMaker::reset() { deleteMembers(); fChildren.reset(); fHelpers.reset(); fIDs.reset(); fEvents.reset(); fDisplayList.hardReset(); }
SkAnimateMaker::~SkAnimateMaker() { deleteMembers(); }
SkDisplayEvent::~SkDisplayEvent() { deleteMembers(); }
GameConsole::GameConsole( Node *parent ) : Node( parent ), gameThread( new QThread ), // Global pipeline microTimer( new MicroTimer ), remapper( new Remapper ), sdlManager( new SDLManager ), sdlUnloader( new SDLUnloader ), // Dynamic pipeline audioOutput( new AudioOutput ), libretroLoader( new LibretroLoader ), libretroRunner( new LibretroRunner ), libretroVariableForwarder( new LibretroVariableForwarder ) { // Move all our stuff to the game thread audioOutput->moveToThread( gameThread ); libretroLoader->moveToThread( gameThread ); libretroRunner->moveToThread( gameThread ); libretroVariableForwarder->moveToThread( gameThread ); microTimer->moveToThread( gameThread ); remapper->moveToThread( gameThread ); sdlManager->moveToThread( gameThread ); sdlUnloader->moveToThread( gameThread ); gameThread->setObjectName( "Game thread" ); gameThread->start(); // Connect global pipeline (at least the parts that can be connected at this point) connectNodes( microTimer, sdlManager ); connectNodes( sdlManager, remapper ); connectNodes( remapper, sdlUnloader ); connect( this, &GameConsole::remapperModelChanged, this, [ & ] { if( remapperModel ) { qCDebug( phxControl ) << "RemapperModel" << Q_FUNC_INFO << globalPipelineReady(); remapperModel->setRemapper( remapper ); checkIfGlobalPipelineReady(); } } ); // Connect VariableModel (which lives in QML) to LibretroVariableForwarder as soon as it's set connect( this, &GameConsole::variableModelChanged, this, [ & ] { if( variableModel ) { qCDebug( phxControl ) << "VariableModel" << Q_FUNC_INFO << globalPipelineReady(); variableModel->setForwarder( libretroVariableForwarder ); checkIfGlobalPipelineReady(); } } ); // Connect GlobalGamepad (which lives in QML) to the global pipeline as soon as it's set connect( this, &GameConsole::globalGamepadChanged, this, [ & ]() { if( globalGamepad ) { qCDebug( phxControl ) << "GlobalGamepad" << Q_FUNC_INFO << globalPipelineReady(); connectNodes( remapper, globalGamepad ); checkIfGlobalPipelineReady(); } } ); // Connect PhoenixWindow (which lives in QML) to the global pipeline as soon as it's set connect( this, &GameConsole::phoenixWindowChanged, this, [ & ]() { if( phoenixWindow ) { qCDebug( phxControl ) << "PhoenixWindow" << Q_FUNC_INFO << globalPipelineReady(); connectNodes( this, phoenixWindow ); connectNodes( phoenixWindow, microTimer ); checkIfGlobalPipelineReady(); } } ); // Handle app quitting connect( QCoreApplication::instance(), &QCoreApplication::aboutToQuit, this, [ = ]() { qDebug() << ""; qCInfo( phxControl ) << ">>>>>>>> User requested app to close, shutting down (waiting up to 30 seconds)..."; qDebug() << ""; // Tell the pipeline to stop if loaded if( dynamicPipelineReady() ) { quitFlag = true; emit commandOut( Command::Stop, QVariant(), nodeCurrentTime() ); } else { qCInfo( phxControl ) << "No core loaded"; gameThread->quit(); } // Wait up to 30 seconds to let the pipeline finish its events if( gameThread != QThread::currentThread() ) { gameThread->wait( 30 * 1000 ); gameThread->deleteLater(); } // Destroy our global pipeline objects *from the bottom up* (depending on core type) if( source[ "type" ] == QStringLiteral( "libretro" ) || pendingPropertyChanges[ "source" ].toMap()[ "type" ] == QStringLiteral( "libretro" ) ) { deleteLibretro(); } // Send a second set of delete calls for all other objects (redundant calls will be ignored) deleteMembers(); qDebug() << ""; qCInfo( phxControl ) << ">>>>>>>> Fully unloaded!"; qDebug() << ""; } ); connect( this, &GameConsole::userDataLocationChanged, this, [ & ] { emit commandOut( Command::SetUserDataPath, userDataLocation, nodeCurrentTime() ); } ); }