From f8a7dd5f4162313d76ae2e2df46740f3a9e49071 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Tue, 19 Jan 2010 13:01:33 +0000 Subject: [PATCH] Don't make full copy of string in wxThreadEvent::Clone(). It's enough to do it once to ensure thread-safety. Doing it twice (once in copy ctor called by Clone(), once in Clone() itself) only wastes time. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63186 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/event.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/include/wx/event.h b/include/wx/event.h index 6c83cb1726..225da47b42 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -1207,12 +1207,7 @@ public: virtual wxEvent *Clone() const { - wxThreadEvent* ev = new wxThreadEvent(*this); - - // make sure our string member (which uses COW, aka refcounting) is not - // shared by other wxString instances: - ev->SetString(GetString().c_str()); - return ev; + return new wxThreadEvent(*this); } // this is important to avoid that calling wxEventLoopBase::YieldFor thread events -- 2.45.2