From 1e8af825e18fe54c9d0413a026b58c5ddad62f6e Mon Sep 17 00:00:00 2001 From: Francesco Montorsi Date: Fri, 20 Feb 2009 12:02:09 +0000 Subject: [PATCH] implement wxThreadEvent safe copy ctor git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59053 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/event.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/wx/event.h b/include/wx/event.h index fb033e636a..b18f39bed8 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -1105,6 +1105,14 @@ public: : wxCommandEvent(eventType, id) { } + wxThreadEvent(const wxThreadEvent& event) + : wxCommandEvent(event) + { + // make sure our string member (which uses COW, aka refcounting) is not + // shared by other wxString instances: + SetString(GetString().c_str()); + } + virtual wxEvent *Clone() const { wxThreadEvent* ev = new wxThreadEvent(*this); @@ -2420,7 +2428,7 @@ public: virtual wxEvent *Clone() const { return new wxNavigationKeyEvent(*this); } - enum + enum wxNavigationKeyEventFlags { IsBackward = 0x0000, IsForward = 0x0001,