@@ -25,6 +25,13 @@ namespace pipetap {
2525 using pipetap::win::IntegrityRidToCStr;
2626 using pipetap::win::RelaunchAsAdministrator;
2727
28+ namespace {
29+ ui::replay::Manager& ReplayManager () { static ui::replay::Manager replay; return replay; }
30+ ui::proxy::Manager& ProxyManager () { static ui::proxy::Manager proxy; return proxy; }
31+ injection::VM& InjectorVm () { static injection::VM inj; return inj; }
32+ ui::pipelist::VM& PipesVm () { static ui::pipelist::VM pipelist; return pipelist; }
33+ }
34+
2835 static void MenuBarRightText (const char * txt, const ImVec4* color = nullptr ) {
2936 float w = ImGui::CalcTextSize (txt).x ;
3037 float full = ImGui::GetWindowContentRegionMax ().x ;
@@ -44,10 +51,10 @@ namespace pipetap {
4451 }
4552
4653 void UI () {
47- static ui:: replay::Manager replay ;
48- static ui:: proxy::Manager proxy ;
49- static injection::VM inj ;
50- static ui:: pipelist::VM pipelist ;
54+ auto & replay = ReplayManager () ;
55+ auto & proxy = ProxyManager () ;
56+ auto & inj = InjectorVm () ;
57+ auto & pipelist = PipesVm () ;
5158
5259 // visibility for each panel
5360 static bool show_replay = true ;
@@ -222,4 +229,13 @@ namespace pipetap {
222229 ImGui::End ();
223230 ImGui::PopStyleVar ();
224231 }
232+
233+ void UIShutdown () {
234+ auto & proxy = ProxyManager ();
235+ for (auto & tab : proxy.tabs ) {
236+ if (tab && tab->client ) {
237+ tab->client ->Stop ();
238+ }
239+ }
240+ }
225241} // namespace pipetap
0 commit comments