diff --git a/winml/adapter/LotusEnvironment.h b/winml/adapter/LotusEnvironment.h index 194d3f4429..b2d9a0ac0e 100644 --- a/winml/adapter/LotusEnvironment.h +++ b/winml/adapter/LotusEnvironment.h @@ -43,15 +43,6 @@ inline onnxruntime::logging::LoggingManager& DefaultLoggingManager() { return default_logging_manager; } -static void OnSuspending(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::ApplicationModel::SuspendingEventArgs const& args) { -#ifdef LAYERING_DONE - if (!profiler.IsStillReset()) //If profiler is still reset, then don't log RuntimePerf - { - telemetry_helper.LogRuntimePerf(profiler, true); - } -#endif -} - class LotusEnvironment { public: LotusEnvironment() { @@ -74,14 +65,10 @@ class LotusEnvironment { [](int) { return std::make_unique(); }, std::numeric_limits::max()); } - RegisterSuspendHandler(); } ~LotusEnvironment() { TraceLoggingUnregister(winmla::winml_trace_logging_provider); - if (suspend_token_) { - winrt::Windows::ApplicationModel::Core::CoreApplication::Suspending(suspend_token_); - } } const onnxruntime::logging::Logger* GetDefaultLogger() { @@ -89,15 +76,7 @@ class LotusEnvironment { } private: - void RegisterSuspendHandler() { - try { - suspend_token_ = winrt::Windows::ApplicationModel::Core::CoreApplication::Suspending( - winrt::Windows::Foundation::EventHandler(&OnSuspending)); - } catch (...) {}//Catch in case CoreApplication cannot be found for non-UWP executions - } - std::unique_ptr lotus_environment_; - winrt::event_token suspend_token_; onnxruntime::logging::LoggingManager* default_logging_manager_; };