--- nono/cli/cli_app.cpp 2026/04/29 17:05:16 1.1.1.11 +++ nono/cli/cli_app.cpp 2026/04/29 17:05:23 1.1.1.12 @@ -12,8 +12,8 @@ #include "cuimessage.h" #include "kevent.h" #include "mainapp.h" +#include "monitor.h" #include "power.h" -#include "vm.h" // wxApp と相似にするためのクラス class CLIApp @@ -59,6 +59,11 @@ CLIApp::OnInit() if (kq < 0) { return EXIT_FAILURE; } + + // モニタ登録締切。CLI ではあまり関係ないけど揃えておく。 + gMonitorManager->Fix(); + + // スレッド作成を伴う初期化。 if (!gMainApp.Init2()) { return EXIT_FAILURE; } @@ -66,6 +71,9 @@ CLIApp::OnInit() // メインウィンドウに相当するところ OnCreate(); + // 戻ってきたので、VM を解放。 + gMainApp.Dispose(); + return EXIT_SUCCESS; } @@ -84,7 +92,7 @@ CLIApp::OnCreate() // 電源投入 auto power = GetPowerDevice(); - power->PowerButton(); + power->PushPowerButton(); // メッセージを待つ while (exit_request == false) { @@ -111,9 +119,6 @@ CLIApp::OnCreate() CUIMessage::Dispatch(m); } - // VM を解放 - gVM->Dispose(); - return 0; }