LunarLander: Fix race condition causing crash on exit

When exiting the LunarLander sample, it was possible for the canvas
to get destroyed before execution was halted.

Added additional synchronization to make sure the current run-state
is accounted for before performing a canvas update.

Also updated deprecated constants in lunar_layout.xml.

Bug: 6164549
Change-Id: I9a710f6b128491f1beece84dd39ab00f4937a4c6
This commit is contained in:
Trevor Johns
2012-10-31 16:58:00 -07:00
parent 42d7eefb86
commit b69d09ecd9
3 changed files with 23 additions and 11 deletions

View File

@@ -149,8 +149,8 @@ public class LunarLander extends Activity {
*/
@Override
protected void onPause() {
super.onPause();
mLunarView.getThread().pause(); // pause game when Activity pauses
super.onPause();
}
/**