--- nono/wx/wxapp.cpp 2026/04/29 17:05:31 1.1.1.16 +++ nono/wx/wxapp.cpp 2026/04/29 17:05:44 1.1.1.19 @@ -100,15 +100,27 @@ WXApp::OnRun() item_fontsize.Err("Must be either 12, 16 or 24"); return EXIT_FAILURE; } - pFontManager.reset(new FontManager()); + try { + pFontManager.reset(new FontManager()); + } catch (...) { } + if ((bool)pFontManager == false) { + warnx("Failed to initialize FontManager"); + return EXIT_FAILURE; + } gFontManager = pFontManager.get(); gFontManager->SetFont(fontid); // ホスト情報用のモニタ (どこでやるのがいいか) - pHostInfo.reset(new HostInfoMonitor()); + try { + pHostInfo.reset(new HostInfoMonitor()); + } catch (...) { } + if ((bool)pHostInfo == false) { + warnx("Failed to initialize HostInfoMonitor"); + return EXIT_FAILURE; + } gHostInfo = pHostInfo.get(); - // 手順 4. (vm/device.h) + // 手順 6. (vm/device.h) // これ以降モニタの登録をしてはいけない。 gMonitorManager->Fix(); @@ -329,8 +341,13 @@ WXApp::SearchMonitorName(const char *nam for (uint id = ID_MONITOR_START; id <= ID_SUBWIN_END; id++) { if (id < ID_SUBWIN_START) { - // モニターは登録されていなければ除外する - if (gMonitorManager->Find(id) == NULL) { + // モニターは登録されていなければ除外する。 + Monitor *mon = gMonitorManager->Find(id); + if (mon == NULL) { + continue; + } + // SLIRP モニタだけ、登録はされてて obj が NULL という状態がある。 + if (mon->obj == NULL) { continue; } } else {