diff --git a/include/wx/weakref.h b/include/wx/weakref.h index d72ab4ccbc..6691b60d6d 100644 --- a/include/wx/weakref.h +++ b/include/wx/weakref.h @@ -200,6 +200,12 @@ public: Assign(pobj); } + // We need this copy ctor, since otherwise a default compiler (binary) copy happens + wxWeakRef(const wxWeakRef& wr) + { + Assign(wr.get()); + } + template wxWeakRef& operator=(TDerived* pobj) { diff --git a/interface/weakref.h b/interface/weakref.h index 03a9663130..f6522aa399 100644 --- a/interface/weakref.h +++ b/interface/weakref.h @@ -105,6 +105,11 @@ public: */ wxWeakRef(T* pobj = NULL); + /** + Copy constructor. + */ + wxWeakRef(const wxWeakRef& wr); + /** Destructor. */