assigned arch static instance instead of create a new one #4313

This commit is contained in:
XinyuHou 2015-02-13 15:58:54 +00:00
parent 4014176d8e
commit 226f2c966a
2 changed files with 3 additions and 1 deletions

View File

@ -120,6 +120,8 @@ public:
*/
static Arch* getInstance();
static void setInstance(Arch* s) { s_instance = s; }
ARCH_PLUGIN& plugin() const { return (ARCH_PLUGIN&)m_plugin; }
ARCH_INTERNET& internet() const { return (ARCH_INTERNET&)m_internet; }

View File

@ -39,7 +39,7 @@ init(void* log, void* arch)
}
if (g_arch == NULL) {
g_arch = new Arch(reinterpret_cast<Arch*>(arch));
Arch::setInstance(reinterpret_cast<Arch*>(arch));
}
}