From ab7e46122681230109cb87810efc79603442964c Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi <> Date: Tue, 21 Apr 2009 18:50:58 -0700 Subject: [PATCH] AI 147296: Reuse the JetPlayer singleton instance in the initialization of JetBoy instead of destroying it. BUG=1804737 Automated import of CL 147296 --- .../src/com/example/android/jetboy/JetBoyView.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/samples/JetBoy/src/com/example/android/jetboy/JetBoyView.java b/samples/JetBoy/src/com/example/android/jetboy/JetBoyView.java index 3a49a8778..1b179252e 100755 --- a/samples/JetBoy/src/com/example/android/jetboy/JetBoyView.java +++ b/samples/JetBoy/src/com/example/android/jetboy/JetBoyView.java @@ -416,14 +416,8 @@ public class JetBoyView extends SurfaceView implements SurfaceHolder.Callback { */ private void initializeJetPlayer() { - // JET info: this is what we do to undesirable instances: we release them! - if (mJet != null) - { - mJet.release(); - mJet = null; - } - - // JET info: let's create our JetPlayer instance using the factory + // JET info: let's create our JetPlayer instance using the factory. + // JET info: if we already had one, the same singleton is returned. mJet = JetPlayer.getJetPlayer(); mJetPlaying = false;