Browse Source

prevent segfault deleting a device with an unattached wire

master
aj_genius 21 years ago
parent
commit
be41242ab5
3 changed files with 15 additions and 2 deletions
  1. +8
    -1
      GUI/Widgets/Fl_Canvas.C
  2. +6
    -0
      SpiralSound/Plugins/SpiralPlugin.C
  3. +1
    -1
      SpiralSound/Plugins/SpiralPlugin.h

+ 8
- 1
GUI/Widgets/Fl_Canvas.C View File

@@ -458,7 +458,14 @@ void Fl_Canvas::PortClicked(Fl_DeviceGUI* Device, int Type, int Port, bool Value
void Fl_Canvas::ClearConnections(Fl_DeviceGUI* Device)
{
bool removedall=false;
//make sure we don't leave a dangling incomplete wire this will cause errors/seg-faults
if (UserMakingConnection() && Device && ((Device->GetID() == m_IncompleteWire.OutputID) ||
(Device->GetID() == m_IncompleteWire.InputID)))
{
ClearIncompleteWire();
}
while (!removedall)
{
removedall=true;


+ 6
- 0
SpiralSound/Plugins/SpiralPlugin.C View File

@@ -44,6 +44,12 @@ SpiralPlugin::~SpiralPlugin()
delete m_AudioCH;
}

bool SpiralPlugin::Kill()
{
m_IsDead = true;
return true;
}

PluginInfo &SpiralPlugin::Initialise(const HostInfo *Host)
{
m_HostInfo=Host;


+ 1
- 1
SpiralSound/Plugins/SpiralPlugin.h View File

@@ -77,7 +77,7 @@ public:

// execute the audio
virtual void Execute()=0;
virtual bool Kill() {m_IsDead = true; return true;}
virtual bool Kill();

// run the commands from the GUI
virtual void ExecuteCommands() {}


Loading…
Cancel
Save