aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/c_src/wxe_helpers.cpp
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2016-04-15 10:19:59 +0200
committerDan Gudmundsson <[email protected]>2016-04-22 09:14:00 +0200
commit7604209d02278b5547ae42fb328bfbc7d9043963 (patch)
tree7a71240377cd142b9395d27cafa9e951f06fd9a1 /lib/wx/c_src/wxe_helpers.cpp
parent9bff4dbbaf44ff563b3d67c65061f5f0a7d7f944 (diff)
downloadotp-7604209d02278b5547ae42fb328bfbc7d9043963.tar.gz
otp-7604209d02278b5547ae42fb328bfbc7d9043963.tar.bz2
otp-7604209d02278b5547ae42fb328bfbc7d9043963.zip
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.
Diffstat (limited to 'lib/wx/c_src/wxe_helpers.cpp')
-rw-r--r--lib/wx/c_src/wxe_helpers.cpp4
1 files changed, 2 insertions, 2 deletions
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;
}
}