If the previous trick does not work, try disrupting the shutter. If your camera supports manual modes, you can use shutter priority or manual to set the shutter speed to the bulb or the slowest possible setting. If your camera does not support manual modes, you can try using a scene-setting designed for low-light photography, such as sunset or fireworks. After that, take a photo and, while the camera is still taking pictures, remove the battery (but do not switch off the camera)
If your camera does not allow manual settings, you must be quick to remove the battery while taking pictures. The shutter will be interrupted and may begin to release as a result. The procedure may need to be repeated several times.