| 179 | |
| 180 | |
| 181 | void GigInstrument::freeInstance() |
| 182 | { |
| 183 | QMutexLocker synthLock( &m_synthMutex ); |
| 184 | QMutexLocker notesLock( &m_notesMutex ); |
| 185 | |
| 186 | if( m_instance != NULL ) |
| 187 | { |
| 188 | delete m_instance; |
| 189 | m_instance = NULL; |
| 190 | |
| 191 | // If we're changing instruments, we got to make sure that we |
| 192 | // remove all pointers to the old samples and don't try accessing |
| 193 | // that instrument again |
| 194 | m_instrument = NULL; |
| 195 | m_notes.clear(); |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | |
| 200 |