File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,6 +47,9 @@ static void event_handler(lv_obj_t* obj, lv_event_t event) {
4747 AMX* amx = (AMX*) lv_obj_get_user_data (lv_scr_act ());
4848 int handler_index = (int ) lv_obj_get_user_data (obj);
4949
50+ if (PAWN_INST->is_errored )
51+ return ;
52+
5053 amx_Push (amx, event);
5154 int result = amx_Exec (amx, nullptr , handler_index);
5255 if (result != AMX_ERR_NONE) {
@@ -662,6 +665,7 @@ void Pawn::ShowError(unsigned int amx_err) {
662665}
663666
664667void Pawn::ShowError (const char * msg) {
668+ is_errored = true ;
665669 CleanUI ();
666670
667671 lv_obj_t * msglbl = lv_label_create (lv_scr_act (), nullptr );
@@ -687,7 +691,7 @@ void Pawn::QueueError(unsigned int amx_err) {
687691}
688692
689693bool Pawn::OnTouchEvent (TouchEvents event) {
690- if (gesture_index < 0 )
694+ if (gesture_index < 0 || is_errored )
691695 return false ;
692696
693697 cell ret;
@@ -704,7 +708,7 @@ bool Pawn::OnTouchEvent(TouchEvents event) {
704708}
705709
706710bool Pawn::OnTouchEvent (uint16_t x, uint16_t y) {
707- if (touch_index < 0 )
711+ if (touch_index < 0 || is_errored )
708712 return false ;
709713
710714 cell ret;
Original file line number Diff line number Diff line change @@ -92,6 +92,8 @@ namespace Pinetime {
9292 amxPool amx_pool;
9393 std::unique_ptr<File> file;
9494
95+ bool is_errored = false ;
96+
9597 private:
9698 AMX amx;
9799
You can’t perform that action at this time.
0 commit comments