author | zecke <zecke> | 2004-09-21 16:01:21 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-09-21 16:01:21 (UTC) |
commit | 56f3bcad1a0abd199a458a62c8bde0ebdff035d5 (patch) (side-by-side diff) | |
tree | 9f81f2d9ae430f98079149f53dd86eddd09ceec8 | |
parent | 97e20b7cc746d5e2822385fc815739853a9c6e2f (diff) | |
download | opie-56f3bcad1a0abd199a458a62c8bde0ebdff035d5.zip opie-56f3bcad1a0abd199a458a62c8bde0ebdff035d5.tar.gz opie-56f3bcad1a0abd199a458a62c8bde0ebdff035d5.tar.bz2 |
Only disconnect from sender if sender() is valid
-rw-r--r-- | libopie2/opiecore/device/odevice.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp index ec861ee..b5ae4e5 100644 --- a/libopie2/opiecore/device/odevice.cpp +++ b/libopie2/opiecore/device/odevice.cpp @@ -759,49 +759,51 @@ void ODevice::addPreHandler(QWSServer::KeyboardFilter*aFilter) Opie::Core::OKeyFilter::inst()->addPreHandler(aFilter); } /** * \brief Remove the QWSServer::KeyboardFilter in the param from the list * * Remove the QWSServer::KeyboardFilter \par aFilter from the List * of Keyfilters. Call this when you delete the KeyFilter! * * @param aFilter The filter to be removed from the Opie::Core::OKeyFilter * @see Opie::Core::ODevice::addPreHandler */ void ODevice::remPreHandler(QWSServer::KeyboardFilter*aFilter) { Opie::Core::OKeyFilter::inst()->remPreHandler(aFilter); } /** * @internal * * @see changeMixerForAlarm */ void ODevice::playingStopped() { + if ( sender() ) const_cast<QObject*>(sender())->disconnect( this ); + #ifndef QT_NO_SOUND if ( d->m_sound >= 0 ) { ::ioctl ( d->m_sound, MIXER_WRITE( d->m_mixer ), &d->m_vol ); ::close ( d->m_sound ); } #endif } /** * \brief Change the Volume for the Alarm and set it back after playing is finished * * If you play an Alarm Sound you might want to change the Mixer to * full volume and ignore the user setting. After it \sa Sound::isFinished * you would turn the volume back to the user preference. * The problem is that we used to enter the event loop while waiting * for the sound to be finished triggering all kind of reentrance * problems what a library shouldn't introduce. * Instead of manually waiting for the sound to be finished use * this Method and it will automatically restore the Mixer to * the user configuration after the sound finished playing. * * Note: The onwership of \param snd is not transfered and playing * is not started in this method. If 'snd' gets deleted before |