From 85bb4d466efeb2540363065d7c0987a9d60f70e9 Mon Sep 17 00:00:00 2001 From: crupest Date: Wed, 19 Sep 2018 01:15:01 +0800 Subject: finish animation!!! --- CruUI/application.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'CruUI/application.cpp') diff --git a/CruUI/application.cpp b/CruUI/application.cpp index f1d57153..78b44d7e 100644 --- a/CruUI/application.cpp +++ b/CruUI/application.cpp @@ -2,6 +2,7 @@ #include +#include "exception.h" #include "timer.h" #include "ui/window.h" #include "graph/graph.h" @@ -96,13 +97,14 @@ namespace cru { window_manager_ = std::make_unique(); graph_manager_ = std::make_unique(); timer_manager_ = std::make_unique(); - animation_manager_ = std::make_unique(); + animation_manager_ = std::make_unique(); god_window_ = std::make_unique(this); } Application::~Application() { + animation_manager_.reset(); instance_ = nullptr; } @@ -128,6 +130,6 @@ namespace cru { auto p_action_copy = new InvokeLaterAction(std::move(action)); if (PostMessageW(Application::GetInstance()->GetGodWindow()->GetHandle(), invoke_later_message_id, reinterpret_cast(p_action_copy), 0) == 0) - throw std::runtime_error(fmt::format("Last error: {}.", ::GetLastError())); + throw Win32Error(::GetLastError(), "InvokeLater failed to post message."); } } -- cgit v1.2.3