summaryrefslogtreecommitdiff
path: root/libs/ui/FramebufferNativeWindow.cpp
diff options
context:
space:
mode:
author Jack Palevich <jackpal@google.com> 2009-10-28 19:38:05 -0700
committer Jack Palevich <jackpal@google.com> 2009-10-28 19:38:05 -0700
commit4a943184544159a57ca749af53bab0f1a98435a1 (patch)
treea72f93480890619c6094c70ef8cafb4e397bdba8 /libs/ui/FramebufferNativeWindow.cpp
parent31957f1badbb900bbfe211317e1ea992d650a72d (diff)
Avoid trying to throw multiple exceptions at once.
The typical usage pattern for the get_char helper function is: bool thrown = false; n = get_char(env, s, 0, 1000, &thrown); n += get_char(env, s, 1, 100, &thrown); n += get_char(env, s, 2, 10, &thrown); n += get_char(env, s, 3, 1, &thrown); if (thrown) return false; As you can see, get_char is called multiple times before the thrown flag is checked. If the input text contains multiple incorrect characters, then we have to guard against throwing the same exception multiple times. (Because doing so will cause the Dalvik runtime to abort.) The fix is simple: modify get_char to check if an exception has already been thrown before throwing a new exception.
Diffstat (limited to 'libs/ui/FramebufferNativeWindow.cpp')
0 files changed, 0 insertions, 0 deletions