From f0b2d8b0aff0dbea89d222fb2fa3c1b4a9b7224e Mon Sep 17 00:00:00 2001 From: Amadeus Folego Date: Tue, 13 Jan 2015 01:51:27 -0200 Subject: [PATCH] Fix export crashes adding gui checks --- src/core/Song.cpp | 15 ++++++++------- src/tracks/Pattern.cpp | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/core/Song.cpp b/src/core/Song.cpp index 4c62a1062..3dfa1fbd0 100644 --- a/src/core/Song.cpp +++ b/src/core/Song.cpp @@ -759,15 +759,16 @@ void Song::clearProject() Engine::mixer()->lock(); - if( gui->getBBEditor() ) + + if( gui && gui->getBBEditor() ) { gui->getBBEditor()->trackContainerView()->clearAllTracks(); } - if( gui->songEditor() ) + if( gui && gui->songEditor() ) { gui->songEditor()->m_editor->clearAllTracks(); } - if( gui->fxMixerView() ) + if( gui && gui->fxMixerView() ) { gui->fxMixerView()->clear(); } @@ -777,12 +778,12 @@ void Song::clearProject() Engine::fxMixer()->clear(); - if( gui->automationEditor() ) + if( gui && gui->automationEditor() ) { gui->automationEditor()->setCurrentPattern( NULL ); } - if( gui->pianoRoll() ) + if( gui && gui->pianoRoll() ) { gui->pianoRoll()->reset(); } @@ -800,7 +801,7 @@ void Song::clearProject() Engine::mixer()->unlock(); - if( gui->getProjectNotes() ) + if( gui && gui->getProjectNotes() ) { gui->getProjectNotes()->clear(); } @@ -1044,7 +1045,7 @@ void Song::loadProject( const QString & _file_name ) m_loadingProject = false; m_modified = false; - if( gui->mainWindow() ) + if( gui && gui->mainWindow() ) { gui->mainWindow()->resetWindowTitle(); } diff --git a/src/tracks/Pattern.cpp b/src/tracks/Pattern.cpp index c36418eef..10ce2bca1 100644 --- a/src/tracks/Pattern.cpp +++ b/src/tracks/Pattern.cpp @@ -585,7 +585,7 @@ void Pattern::updateBBTrack() Engine::getBBTrackContainer()->updateBBTrack( this ); } - if( gui->pianoRoll() && gui->pianoRoll()->currentPattern() == this ) + if( gui && gui->pianoRoll() && gui->pianoRoll()->currentPattern() == this ) { gui->pianoRoll()->update(); }