author | zecke <zecke> | 2004-09-21 16:01:21 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-09-21 16:01:21 (UTC) |
commit | 56f3bcad1a0abd199a458a62c8bde0ebdff035d5 (patch) (unidiff) | |
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 | 4 |
1 files changed, 3 insertions, 1 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 | |||
@@ -767,33 +767,35 @@ void ODevice::addPreHandler(QWSServer::KeyboardFilter*aFilter) | |||
767 | * | 767 | * |
768 | * @param aFilter The filter to be removed from the Opie::Core::OKeyFilter | 768 | * @param aFilter The filter to be removed from the Opie::Core::OKeyFilter |
769 | * @see Opie::Core::ODevice::addPreHandler | 769 | * @see Opie::Core::ODevice::addPreHandler |
770 | */ | 770 | */ |
771 | void ODevice::remPreHandler(QWSServer::KeyboardFilter*aFilter) | 771 | void ODevice::remPreHandler(QWSServer::KeyboardFilter*aFilter) |
772 | { | 772 | { |
773 | Opie::Core::OKeyFilter::inst()->remPreHandler(aFilter); | 773 | Opie::Core::OKeyFilter::inst()->remPreHandler(aFilter); |
774 | } | 774 | } |
775 | 775 | ||
776 | 776 | ||
777 | /** | 777 | /** |
778 | * @internal | 778 | * @internal |
779 | * | 779 | * |
780 | * @see changeMixerForAlarm | 780 | * @see changeMixerForAlarm |
781 | */ | 781 | */ |
782 | void ODevice::playingStopped() { | 782 | void ODevice::playingStopped() { |
783 | const_cast<QObject*>(sender())->disconnect( this ); | 783 | if ( sender() ) |
784 | const_cast<QObject*>(sender())->disconnect( this ); | ||
785 | |||
784 | #ifndef QT_NO_SOUND | 786 | #ifndef QT_NO_SOUND |
785 | if ( d->m_sound >= 0 ) { | 787 | if ( d->m_sound >= 0 ) { |
786 | ::ioctl ( d->m_sound, MIXER_WRITE( d->m_mixer ), &d->m_vol ); | 788 | ::ioctl ( d->m_sound, MIXER_WRITE( d->m_mixer ), &d->m_vol ); |
787 | ::close ( d->m_sound ); | 789 | ::close ( d->m_sound ); |
788 | } | 790 | } |
789 | #endif | 791 | #endif |
790 | } | 792 | } |
791 | 793 | ||
792 | 794 | ||
793 | /** | 795 | /** |
794 | * \brief Change the Volume for the Alarm and set it back after playing is finished | 796 | * \brief Change the Volume for the Alarm and set it back after playing is finished |
795 | * | 797 | * |
796 | * If you play an Alarm Sound you might want to change the Mixer to | 798 | * If you play an Alarm Sound you might want to change the Mixer to |
797 | * full volume and ignore the user setting. After it \sa Sound::isFinished | 799 | * full volume and ignore the user setting. After it \sa Sound::isFinished |
798 | * you would turn the volume back to the user preference. | 800 | * you would turn the volume back to the user preference. |
799 | * The problem is that we used to enter the event loop while waiting | 801 | * The problem is that we used to enter the event loop while waiting |