Boost logo

Boost Users :

Subject: [Boost-users] [boost-users][signal] When can a connection become NULL ?
From: Oliver Kania (kania.oliver_at_[hidden])
Date: 2008-11-21 07:42:00


Hello,
I have the problem of a connection becoming invalid (being set to NULL) even
though
none of the things mentioned in the signals documentation happens:

Signal/slot disconnections occur when any of these conditions occur:

   -

   The connection is explicitly disconnected via the connection's
disconnectmethod directly, or indirectly via the signal's
   disconnect method or scoped_connection's destructor.
   -

   A trackable object bound to the slot is destroyed.
   -

   The signal is destroyed.

Is anyone aware of other conditions under which a connection could become
NULL ?

Here is a code snippet:

-----------------------------------------------------------------
boost::signal<int(vtkLookupTable*)> m_signal;
boost::signals::connection m_connection;
....
CScalarBarLayerGeometry* l_receive =
cast_poly<CScalarBarLayerGeometry*>(p_layer->GetGeometry())
m_connection =
m_signal.connect(boost::bind(&CScalarBarLayerGeometry::SetLookupTable,l_receive,
_1));
-------------------------------------------------------------------

The first time I invoke m_connection.connected()
it returns true. The second time it returns false and the connection is
NULL.

Any help would be appreciated.
Best regards, Oliver



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net