Skip to content
Browse files

Fix crash when deleting complex signal chains

  • Loading branch information...
1 parent 063c393 commit 4c965cf5eb2947fd62c1e7b70351add9bdd5c157 jsiegle committed Jan 22, 2014
Showing with 12 additions and 7 deletions.
  1. +10 −7 Source/UI/EditorViewport.cpp
  2. +2 −0 Source/UI/UIComponent.cpp
View
17 Source/UI/EditorViewport.cpp
@@ -139,13 +139,13 @@ void EditorViewport::paint(Graphics& g)
//int w = 30;
//int h = getHeight() - 2*(borderSize+2);
- if (editorArray.size() > 0)
- {
- if (!editorArray[0]->getProcessor()->isSource())
- g.drawImageAt(sourceDropImage, x, y);
- } else {
+ //if (editorArray.size() > 0)
+ //{
+ //if (!editorArray[0]->getProcessor()->isSource())
+ // g.drawImageAt(sourceDropImage, x, y);
+ //} else {
g.drawImageAt(sourceDropImage, x, y);
- }
+ //}
}
bool EditorViewport::isInterestedInDragSource(const SourceDetails& dragSourceDetails)
@@ -279,8 +279,11 @@ void EditorViewport::itemDropped(const SourceDetails& dragSourceDetails)
void EditorViewport::clearSignalChain()
{
+
if (canEdit)
{
+ editorArray.clear();
+ //const MessageManagerLock mmLock; // prevent redraw while deleting
std::cout << "Clearing signal chain." << std::endl;
signalChainManager->clearSignalChain();
getProcessorGraph()->clearSignalChain();
@@ -294,7 +297,7 @@ void EditorViewport::clearSignalChain()
}
- //repaint();
+ repaint();
}
void EditorViewport::makeEditorVisible(GenericEditor* editor, bool highlight, bool updateSettings)
View
2 Source/UI/UIComponent.cpp
@@ -439,8 +439,10 @@ bool UIComponent::perform(const InvocationInfo& info)
break;
}
case clearSignalChain:
+ {
getEditorViewport()->clearSignalChain();
break;
+ }
case showHelp:
std::cout << "SHOW ME SOME HELP!" << std::endl;

0 comments on commit 4c965cf

Please sign in to comment.
Something went wrong with that request. Please try again.