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:
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user