Your message dated Mon, 17 Dec 2007 13:59:12 +0100
with message-id <[EMAIL PROTECTED]>
and subject line This has been fixed (probably long ago)
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: libsigc++-2.0
Severity: normal
Tags: patch

sigc::slot can be used as a function pointer with the advantage of being
able to add function arguments with sigc::bind, etc.  However,
disconnecting such slots does not work, because it doesn't do anything
if there is no parent to notify.

In my programs it is quite usual that there isn't a parent, because I
know what happens to the slot, so I don't need a notification.  However,
I still need to invalidate the slot sometimes, and even
slot = sigc::slot0 <void> ();
doesn't work, because that simply calls disconnect ().

The attached patch invalidates the slot on disconnect, even if there is
no parent.

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.11
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
--- slot_base.cc	2005-09-02 15:39:48.000000000 +0200
+++ libsigc++-2.0.10/sigc++/functors/slot_base.cc	2005-02-11 11:59:07.000000000 +0100
@@ -40,11 +40,11 @@ void slot_rep::operator delete(void* p)
 
 void slot_rep::disconnect()
 {
-  call_ = 0;            // Invalidate the slot.
-                        // _Must_ be done here because parent_ might defer the actual
-                        // destruction of the slot_rep and try to invoke it before that point.
   if (parent_)
   {
+    call_ = 0;          // Invalidate the slot.
+                        // _Must_ be done here because parent_ might defer the actual
+                        // destruction of the slot_rep and try to invoke it before that point.
     void* data_ = parent_;
     parent_ = 0;        // Just a precaution.
     (cleanup_)(data_);  // Notify the parent (might lead to destruction of this!).

--- End Message ---
--- Begin Message ---
Version: 2.0.17-2

I don't remember seeing this problem for a long time.  I just checked,
and it is indeed fixed.  I'm closing this bug.

Thanks,
Bas

-- 
I encourage people to send encrypted e-mail (see http://www.gnupg.org).
If you have problems reading my e-mail, use a better reader.
Please send the central message of e-mails as plain text
   in the message body, not as HTML and definitely not as MS Word.
Please do not use the MS Word format for attachments either.
For more information, see http://pcbcn10.phys.rug.nl/e-mail.html

Attachment: signature.asc
Description: Digital signature


--- End Message ---

Reply via email to