aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2018-11-07 20:46:57 +0800
committercrupest <crupest@outlook.com>2018-11-07 20:46:57 +0800
commit6f76a0ad3df99ea0d99623347d019536cc07e920 (patch)
treeb44d8cd6f8f4ffbbb6451d42ba9a6b4d98828aec
parente2efeb22595b263f6eac5563b163a2574aa2f0dc (diff)
downloadcru-6f76a0ad3df99ea0d99623347d019536cc07e920.tar.gz
cru-6f76a0ad3df99ea0d99623347d019536cc07e920.tar.bz2
cru-6f76a0ad3df99ea0d99623347d019536cc07e920.zip
Fix bugs in release mode.
-rw-r--r--src/cru_debug.h4
-rw-r--r--src/main.cpp3
2 files changed, 4 insertions, 3 deletions
diff --git a/src/cru_debug.h b/src/cru_debug.h
index a9800774..c750e11f 100644
--- a/src/cru_debug.h
+++ b/src/cru_debug.h
@@ -30,13 +30,13 @@ namespace cru::debug
return std::move(result);
}
#else
- inline void DebugTime(Function<void()>&& action, const StringView& hint_message)
+ inline void DebugTime(const std::function<void()>& action, const StringView& hint_message)
{
action();
}
template<typename TReturn>
- TReturn DebugTime(Function<TReturn()>&& action, const StringView& hint_message)
+ TReturn DebugTime(const std::function<TReturn()>& action, const StringView& hint_message)
{
return action();
}
diff --git a/src/main.cpp b/src/main.cpp
index 5fd59ede..f2e65dd2 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -101,11 +101,12 @@ int APIENTRY wWinMain(
inner_layout->AddChild(TextBlock::Create(L"Toggle debug border"));
const auto toggle_button = ToggleButton::Create();
+#ifdef CRU_DEBUG_LAYOUT
toggle_button->toggle_event.AddHandler([&window](cru::ui::events::ToggleEventArgs& args)
{
window.SetDebugLayout(args.GetNewState());
});
-
+#endif
inner_layout->AddChild(toggle_button);
layout->AddChild(inner_layout);
}