From 8caa79e389b636be72e10824943271cf8b9b84d5 Mon Sep 17 00:00:00 2001 From: Ivan Gagis Date: Mon, 19 Aug 2024 13:38:29 +0300 Subject: [PATCH] update --- tests/app/src/main.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/app/src/main.cpp b/tests/app/src/main.cpp index 2fc7e41..24e327a 100644 --- a/tests/app/src/main.cpp +++ b/tests/app/src/main.cpp @@ -77,7 +77,7 @@ class simple_widget : this->context.get().updater.get().stop(*this); }else{ this->context.get().updater.get().start( - utki::make_shared_from(*this).to_shared_ptr(), + utki::make_shared_from(*this), 0 ); } @@ -524,8 +524,7 @@ class application : public ruisapp::application{ // cube click_proxy { - auto cube = c.get().try_get_widget_as("cube_widget"); - ASSERT(cube) + auto& cube = c.get().get_widget_as("cube_widget"); auto& cp = c.get().get_widget_as("cube_click_proxy"); auto& bg = c.get().get_widget_as("cube_bg_color"); @@ -535,11 +534,11 @@ class application : public ruisapp::application{ return true; }; cp.pressed_change_handler(cp); // set initial color - cp.click_handler = [cube](ruis::click_proxy&) -> bool { - if(cube->is_updating()){ - cube->context.get().updater.get().stop(*cube); + cp.click_handler = [cube = utki::make_shared_from(cube)](ruis::click_proxy&) -> bool { + if(cube.get().is_updating()){ + cube.get().context.get().updater.get().stop(cube.get()); }else{ - cube->context.get().updater.get().start(cube, 0); + cube.get().context.get().updater.get().start(cube, 0); } return true; };