|
@@ -2770,8 +2770,41 @@ void ResourceWatcherEntity::FetchSystemSnapshot(
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+#if defined(RVC_OS_WIN)
|
|
|
+
|
|
|
SP_BEGIN_ENTITY_MAP()
|
|
|
SP_ENTITY(ResourceWatcherEntity)
|
|
|
SP_END_ENTITY_MAP()
|
|
|
|
|
|
+#else
|
|
|
+ResourceWatcherEntity cur;
|
|
|
+class SpEntityModuleStub : public ModuleBase
|
|
|
+{
|
|
|
+public:
|
|
|
+ SpEntityModuleStub()
|
|
|
+ {
|
|
|
+
|
|
|
+ try {
|
|
|
+ //ResourceWatcherEntity* cur = new ResourceWatcherEntity();
|
|
|
+ // 内存分配成功
|
|
|
+ m_pEntityArray[m_nEntityCount++] = dynamic_cast<CEntityBase*>(&cur);
|
|
|
+ }
|
|
|
+ catch (const std::bad_alloc& e) {
|
|
|
+ // 内存分配失败,捕获异常
|
|
|
+ Dbg("ResourceWatcher Error: Memory allocation failed for ResourceWatcherEntity. %s", e.what());
|
|
|
+ // 处理错误
|
|
|
+ }
|
|
|
+ catch (...) {
|
|
|
+ Dbg("ResourceWatcher Error: other for ResourceWatcherEntity");
|
|
|
+ }
|
|
|
+ Dbg("ResourceWatcher SpEntityModuleStub end");
|
|
|
+ }
|
|
|
+};
|
|
|
+SpEntityModuleStub g_ModuleInst;
|
|
|
+extern "C" void __attribute__((constructor)) SoMain() {
|
|
|
+ g_ModuleInst.DllMain(NULL, DLL_PROCESS_ATTACH, NULL);
|
|
|
+}
|
|
|
+
|
|
|
+#endif
|
|
|
+
|
|
|
|