Boost logo

Boost-Commit :

From: fmhess_at_[hidden]
Date: 2008-02-27 15:05:27


Author: fmhess
Date: 2008-02-27 15:05:27 EST (Wed, 27 Feb 2008)
New Revision: 43427
URL: http://svn.boost.org/trac/boost/changeset/43427

Log:
A signal used as a slot should throw an expired_slot exception,
instead of a bad_weak_ptr.

Text files modified:
   sandbox/thread_safe_signals/boost/thread_safe_signals/detail/signal_template.hpp | 6 ++++--
   1 files changed, 4 insertions(+), 2 deletions(-)

Modified: sandbox/thread_safe_signals/boost/thread_safe_signals/detail/signal_template.hpp
==============================================================================
--- sandbox/thread_safe_signals/boost/thread_safe_signals/detail/signal_template.hpp (original)
+++ sandbox/thread_safe_signals/boost/thread_safe_signals/detail/signal_template.hpp 2008-02-27 15:05:27 EST (Wed, 27 Feb 2008)
@@ -491,13 +491,15 @@
         result_type operator ()(BOOST_SIGNAL_SIGNATURE_FULL_ARGS(BOOST_SIGNALS_NUM_ARGS))
         {
           shared_ptr<signalslib::detail::BOOST_SIGNAL_IMPL_CLASS_NAME<BOOST_SIGNAL_TEMPLATE_INSTANTIATION> >
- shared_pimpl(_weak_pimpl);
+ shared_pimpl(_weak_pimpl.lock());
+ if(shared_pimpl == 0) throw expired_slot();
           return (*shared_pimpl)(BOOST_SIGNAL_SIGNATURE_ARG_NAMES(BOOST_SIGNALS_NUM_ARGS));
         }
         result_type operator ()(BOOST_SIGNAL_SIGNATURE_FULL_ARGS(BOOST_SIGNALS_NUM_ARGS)) const
         {
           shared_ptr<signalslib::detail::BOOST_SIGNAL_IMPL_CLASS_NAME<BOOST_SIGNAL_TEMPLATE_INSTANTIATION> >
- shared_pimpl(_weak_pimpl);
+ shared_pimpl(_weak_pimpl.lock());
+ if(shared_pimpl == 0) throw expired_slot();
           return (*shared_pimpl)(BOOST_SIGNAL_SIGNATURE_ARG_NAMES(BOOST_SIGNALS_NUM_ARGS));
         }
       private:


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk