Androidアプリ 次回起動 落ちる 原因 メモリリーク

//オープンソースのzxingを使ってAndroidアプリを作っているが、
//起動して、戻るボタンで終了して、また起動するとメモリが足りなくて落ちる。
//原因は、メモリリーク。
//viewは明示的に開放してあげる必要があるようだ。
//以下は解決方法。

//XMLのトップレベルのビューがこれだったので、
//allviewというidをつけておいて、これと子を解放する。
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
             android:layout_width="fill_parent"
             android:layout_height="fill_parent"
             android:id="@+id/allview"
             >

//javaのコード側でこの関数をonDestroy()内で呼ぶと、
//リークしないので次回起動時に落ちなくなった
@Override
protected void onDestroy() {
    //画像解放
    cleanupView(findViewById(R.id.allview));
    super.onDestroy();
}
	
//関数定義
  /** 
   * 指定したビュー階層内のドローワブルをクリアする。 
   * (ドローワブルをのコールバックメソッドによるアクティビティのリークを防ぐため) 
   * @param view 
   */ 
  public static final void cleanupView(View view) { 
      if(view instanceof ImageButton) { 
          ImageButton ib = (ImageButton)view; 
          ib.setImageDrawable(null); 
      } else if(view instanceof ImageView) { 
          ImageView iv = (ImageView)view; 
          iv.setImageDrawable(null); 
      } else if(view instanceof SeekBar) { 
          SeekBar sb = (SeekBar)view; 
          sb.setProgressDrawable(null); 
          sb.setThumb(null); 
      // } else if(view instanceof( xxxx )) {  -- 他にもDrawable を使用するUIコンポーネントがあれば追加 
      } 
      view.setBackgroundDrawable(null); 
      if(view instanceof ViewGroup) { 
          ViewGroup vg = (ViewGroup)view; 
          int size = vg.getChildCount(); 
          for(int i = 0; i < size; i++) { 
              cleanupView(vg.getChildAt(i)); 
          } 
      } 
  } 
  
//参考
//日本Androidの会
https://groups.google.com/group/android-group-japan/msg/f385faf0ac47e291?pli=1&hl=ja