Change the factory constructor to not use a predefined wxMBConv object as it
prevents global instances of the factories. The predefined converters are references which may not have been initialised when a global factory's constructor runs. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43445 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -342,7 +342,8 @@ public:
|
|||||||
wxPathFormat format = wxPATH_NATIVE) const = 0;
|
wxPathFormat format = wxPATH_NATIVE) const = 0;
|
||||||
|
|
||||||
void SetConv(wxMBConv& conv) { m_pConv = &conv; }
|
void SetConv(wxMBConv& conv) { m_pConv = &conv; }
|
||||||
wxMBConv& GetConv() const { return *m_pConv; }
|
wxMBConv& GetConv() const
|
||||||
|
{ if (m_pConv) return *m_pConv; else return wxConvLocal; }
|
||||||
|
|
||||||
static const wxArchiveClassFactory *Find(const wxChar *protocol,
|
static const wxArchiveClassFactory *Find(const wxChar *protocol,
|
||||||
wxStreamProtocolType type
|
wxStreamProtocolType type
|
||||||
@@ -363,7 +364,7 @@ protected:
|
|||||||
virtual wxArchiveInputStream *DoNewStream(wxInputStream *stream) const = 0;
|
virtual wxArchiveInputStream *DoNewStream(wxInputStream *stream) const = 0;
|
||||||
virtual wxArchiveOutputStream *DoNewStream(wxOutputStream *stream) const = 0;
|
virtual wxArchiveOutputStream *DoNewStream(wxOutputStream *stream) const = 0;
|
||||||
|
|
||||||
wxArchiveClassFactory() : m_pConv(&wxConvLocal), m_next(this) { }
|
wxArchiveClassFactory() : m_pConv(NULL), m_next(this) { }
|
||||||
wxArchiveClassFactory& operator=(const wxArchiveClassFactory& WXUNUSED(f))
|
wxArchiveClassFactory& operator=(const wxArchiveClassFactory& WXUNUSED(f))
|
||||||
{ return *this; }
|
{ return *this; }
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user