/[svn]/libgig/trunk/src/SF.cpp
ViewVC logotype

Diff of /libgig/trunk/src/SF.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3899 by schoenebeck, Fri Feb 22 12:12:50 2019 UTC revision 3900 by schoenebeck, Wed May 12 17:25:27 2021 UTC
# Line 1189  namespace sf2 { Line 1189  namespace sf2 {
1189      }      }
1190    
1191      void File::DeleteInstrument(Instrument* pInstrument) {      void File::DeleteInstrument(Instrument* pInstrument) {
1192            if (!pInstrument) return;
1193    
1194          for (int i = 0; i < GetPresetCount(); i++) {          for (int i = 0; i < GetPresetCount(); i++) {
1195              Preset* p = GetPreset(i);              Preset* p = GetPreset(i);
1196              if (p == NULL) continue;              if (p == NULL) continue;
# Line 1203  namespace sf2 { Line 1205  namespace sf2 {
1205              if (GetInstrument(i) == pInstrument) {              if (GetInstrument(i) == pInstrument) {
1206                  Instruments[i] = NULL;                  Instruments[i] = NULL;
1207                  delete pInstrument;                  delete pInstrument;
1208                    // an instrument instance only exists once in the list, so stop
1209                    // here (which also silences a clang sanatizer warning about
1210                    // potential multiple memory releases of pInstrument above)
1211                    return;
1212              }              }
1213          }          }
1214      }      }

Legend:
Removed from v.3899  
changed lines
  Added in v.3900

  ViewVC Help
Powered by ViewVC