From 18cd6f624ffc185f2681c1e402e2499dd65d28e0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 28 Feb 2014 22:35:07 +0000 Subject: [PATCH] Document possible problem with unbinding functors. Unbind() may currently disconnect the wrong functor as it compares them by address. See http://thread.gmane.org/gmane.comp.lib.wxwidgets.general/81445 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76033 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- interface/wx/event.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/interface/wx/event.h b/interface/wx/event.h index cb4a6720d1..1403f8e6a4 100644 --- a/interface/wx/event.h +++ b/interface/wx/event.h @@ -995,6 +995,12 @@ public: been added using the Bind<>() method. There is no way to unbind functions bound using the (static) event tables. + @note Currently functors are compared by their address which, + unfortunately, doesn't work correctly if the same address is reused for + two different functor objects. Because of this, using Unbind() is not + recommended if there are multiple functors using the same @a eventType + and @a id and @a lastId as a wrong one could be unbound. + @param eventType The event type associated with this event handler. @param functor