@Decoid You just have to add an on pause method, which i am guessing you haven't as below:
@Override
protected void onPause()
{
super.onPause();
if (!isFlashOn) {
camera.release();
camera = null;
}
}