From 7604209d02278b5547ae42fb328bfbc7d9043963 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Fri, 15 Apr 2016 10:19:59 +0200 Subject: wx: Fix callback problems Commands could be executed twice, if the command was dispatched from a callback and caused a recursive invocation of command loop. Solution is to mark op as -1 before calling wxWidgets. Also commands could be missed when idle processing was done inside while executing a recursive callback, solved be always resetting peak index after idle processing is done. --- lib/wx/c_src/wxe_helpers.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/wx/c_src/wxe_helpers.cpp') diff --git a/lib/wx/c_src/wxe_helpers.cpp b/lib/wx/c_src/wxe_helpers.cpp index 76958a346f..4798e605e8 100644 --- a/lib/wx/c_src/wxe_helpers.cpp +++ b/lib/wx/c_src/wxe_helpers.cpp @@ -47,8 +47,8 @@ void wxeCommand::Delete() if(len > 64) driver_free(buffer); buffer = NULL; - op = -1; } + op = -1; } /* **************************************************************************** @@ -226,7 +226,7 @@ unsigned int wxeFifo::Cleanup(unsigned int def) // Realloced we need to start from the beginning return 0; } else { - return def; + return def < cb_start? def : cb_start; } } -- cgit v1.2.3