Add an extra debug check in Editor::play/stop() functions

There are crashes in Editor::stop(). These asserts
were added just to see if we can catch them.
This commit is contained in:
David Capello 2015-05-28 11:13:15 -03:00
parent f9eb87f6b1
commit 71efdfdf76

View File

@ -1563,12 +1563,20 @@ void Editor::notifyScrollChanged()
void Editor::play()
{
ASSERT(m_state);
if (!m_state)
return;
if (!dynamic_cast<PlayState*>(m_state.get()))
setState(EditorStatePtr(new PlayState));
}
void Editor::stop()
{
ASSERT(m_state);
if (!m_state)
return;
if (dynamic_cast<PlayState*>(m_state.get()))
backToPreviousState();
}