assigned arch static instance instead of create a new one #4313
This commit is contained in:
parent
4014176d8e
commit
226f2c966a
|
@ -120,6 +120,8 @@ public:
|
||||||
*/
|
*/
|
||||||
static Arch* getInstance();
|
static Arch* getInstance();
|
||||||
|
|
||||||
|
static void setInstance(Arch* s) { s_instance = s; }
|
||||||
|
|
||||||
ARCH_PLUGIN& plugin() const { return (ARCH_PLUGIN&)m_plugin; }
|
ARCH_PLUGIN& plugin() const { return (ARCH_PLUGIN&)m_plugin; }
|
||||||
ARCH_INTERNET& internet() const { return (ARCH_INTERNET&)m_internet; }
|
ARCH_INTERNET& internet() const { return (ARCH_INTERNET&)m_internet; }
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ init(void* log, void* arch)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_arch == NULL) {
|
if (g_arch == NULL) {
|
||||||
g_arch = new Arch(reinterpret_cast<Arch*>(arch));
|
Arch::setInstance(reinterpret_cast<Arch*>(arch));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue