~ywwg/mixxx/features_xwax2

« back to all changes in this revision

Viewing changes to mixxx/src/midi/midiscriptengine.cpp

  • Committer: Owen Williams
  • Date: 2011-02-24 23:07:29 UTC
  • Revision ID: owen@ywwg.com-20110224230729-ddbknydv1mmbp007
* fix crash in midiscript: check for NULL before trying to access object

Show diffs side-by-side

added added

removed removed

Lines of Context:
757
757
bool MidiScriptEngine::connectControl(QString group, QString name, QString function, bool disconnect) {
758
758
    ControlObject* cobj = ControlObject::getControl(ConfigKey(group,name));
759
759
    
760
 
    // Don't add duplicates
761
 
    if (!disconnect && m_connectedControls.contains(cobj->getKey(), function)) return true;
762
 
    
763
760
    if (cobj == NULL) {
764
761
        qWarning() << "MidiScriptEngine: script connecting [" << group << "," << name
765
762
                   << "], which is non-existent. ignoring.";
766
763
        return false;
767
764
    }
 
765
    
 
766
    // Don't add duplicates
 
767
    if (!disconnect && m_connectedControls.contains(cobj->getKey(), function)) return true;
768
768
 
769
769
    // When this function runs, assert that somebody is holding the script
770
770
    // engine lock.