title: Database LEAK, when taking a photo. SQLiteDatabase created and never closed. Android, Java, SQLite
body: <p>Greetings yet again. I have an minor issue when taking a photo. I have a button that invokes the camera, successfully takes a photo, and returns to my entry form. My only problem is the database leak that occurs when pressing the button to call the camera. My code looks a little something like this.</p>
  
  <pre><code>public void takephoto(){
  
          Intent in = new
          Intent(this, takephoto.class);
          startActivityForResult(in,1);
      }
  </code></pre>
  
  <p>Here's a snippet of how the database is opened:</p>
  
  <pre><code> public journalDbAdapter open() throws SQLException {
          mDbHelper = new DatabaseHelper(mCtx);
          mDb = mDbHelper.getWritableDatabase();
          return this;
      }
  
      public void close() {
          mDbHelper.close();
      }
  </code></pre>
  
  <p>I run :</p>
  
  <pre><code>mDbHelper = new journalDbAdapter(this);
          mDbHelper.open();
  </code></pre>
  
  <p>In the onCreate of the Activity or Class that I am calling the camera in. I have not coded in mDbHelper.close(); anywhere not sure if i should when or where. I think i would rather just leave it open while capturing one image. </p>
  
  <p>Logcat:</p>
  
  <pre>
  08-17 21:33:37.582: ERROR/Database(18297): java.lang.IllegalStateException: /data/data/com.growjournal.beta/databases/grower SQLiteDatabase created and never closed
  08-17 21:33:37.582: ERROR/Database(18297):     at android.database.sqlite.SQLiteDatabase.(SQLiteDatabase.java:1785)
  </pre>
  
  <p>What possible problems could I face if this was never fixed??</p>
  
  <p>Everything seems to be working fine, but i would defiantly like to avoid any issues amongst the many android devices out there. </p>