MpodAndroid::~MpodAndroid() { if (isEnabled()) { LOGV("MpodAndroid::~MpodAndroid calling disableDevice\n"); disableDevice(); } }
Driver::~Driver() { // Don't throw from destructors... try { disableDevice(); } catch ( const std::exception &e ) { cout << "Driver::~Driver: exception while disabling: " << e.what() << endl; } catch ( ... ) {} }
void DlgPrefController::slotApply() { if (m_bDirty) { // Apply the presets and load the resulting preset. if (m_pInputTableModel != NULL) { m_pInputTableModel->apply(); } if (m_pOutputTableModel != NULL) { m_pOutputTableModel->apply(); } // Load script info from the script table. m_pPreset->scripts.clear(); for (int i = 0; i < m_ui.m_pScriptsTableWidget->rowCount(); ++i) { QString scriptFile = m_ui.m_pScriptsTableWidget->item(i, 0)->text(); // Skip empty rows. if (scriptFile.isEmpty()) { continue; } QString scriptPrefix = m_ui.m_pScriptsTableWidget->item(i, 1)->text(); bool builtin = m_ui.m_pScriptsTableWidget->item(i, 2) ->checkState() == Qt::Checked; ControllerPreset::ScriptFileInfo info; info.name = scriptFile; info.functionPrefix = scriptPrefix; info.builtin = builtin; m_pPreset->scripts.append(info); } // Load the resulting preset (which has been mutated by the input/output // table models). The controller clones the preset so we aren't touching // the same preset. emit(loadPreset(m_pController, m_pPreset)); //Select the "..." item again in the combobox. m_ui.comboBoxPreset->setCurrentIndex(0); bool wantEnabled = m_ui.chkEnabledDevice->isChecked(); bool enabled = m_pController->isOpen(); if (wantEnabled && !enabled) { enableDevice(); } else if (!wantEnabled && enabled) { disableDevice(); } m_bDirty = false; } }
MpodBufferRecorder::~MpodBufferRecorder() { if (mpBuffer != NULL) { delete[] mpBuffer; mpBuffer = NULL; } if (isEnabled()) { OsSysLog::add(FAC_MP, PRI_ERR, "Device is enabled while destroying device!"); disableDevice(); } }
MpidAndroid::~MpidAndroid() { LOGV("MpidAndroid destructor\n"); if (isEnabled()) { LOGV("MpidAndroid enabled, disabling\n"); disableDevice(); } if (mpAudioRecord) { LOGV("Delete AudioRecord: %p\n", mpAudioRecord); delete mpAudioRecord; mpAudioRecord = NULL; #ifdef MPID_ANDROID_CLEAN_EXIT // [ sgAudioRecord = NULL; #endif // MPID_ANDROID_CLEAN_EXIT ] } }
// Destructor MpidWinMM::~MpidWinMM() { // If we happen to still be enabled at this point, disable the device. assert(!isEnabled()); if (isEnabled()) { disableDevice(); } // Delete the sample headers and sample buffer pointers.. unsigned i; for (i = 0; i < mNumInBuffers; i++) { assert(mpWaveBuffers[i] == NULL); if (mpWaveBuffers[i] != NULL) { delete[] mpWaveBuffers[i]; mpWaveBuffers[i] = NULL; } } delete[] mpWaveBuffers; delete[] mpWaveHeaders; }