From b69d09ecd948ed9cad861d8176027b9518725e54 Mon Sep 17 00:00:00 2001 From: Trevor Johns Date: Wed, 31 Oct 2012 16:58:00 -0700 Subject: [PATCH] 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 --- samples/LunarLander/res/layout/lunar_layout.xml | 16 ++++++++-------- .../example/android/lunarlander/LunarLander.java | 2 +- .../example/android/lunarlander/LunarView.java | 16 ++++++++++++++-- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/samples/LunarLander/res/layout/lunar_layout.xml b/samples/LunarLander/res/layout/lunar_layout.xml index f1a899080..bac81881d 100644 --- a/samples/LunarLander/res/layout/lunar_layout.xml +++ b/samples/LunarLander/res/layout/lunar_layout.xml @@ -15,21 +15,21 @@ --> + android:layout_width="fill_parent" + android:layout_height="fill_parent"> + android:layout_width="fill_parent" + android:layout_height="fill_parent"/> + android:layout_width="fill_parent" + android:layout_height="fill_parent" >