A non-transitory, machine-readable data storage medium storing a computer program having program codes which, when executed on a computer, perform a method for operating a gas generator for a safety device for a vehicle, the gas generator having a container for storing gas, and the container having an outlet opening for the gas, which outlet opening is selectively closed off by a closure element, and the apparatus having (i) a first terminal and a second terminal for providing a triggering voltage for triggering the safety device, (ii) a firing device configured to fire in response to a firing current, in order to open the closure element, (iii) an electrical coil configured to actuate, in response to a coil current, the closure device for controlling the gas flow through the outlet opening, the coil being connected in series with the firing device between the first terminal and the second terminal, and (iv) an electrical component having a voltage-dependent resistance and being connected in parallel with the firing device, the method comprising:
- providing the triggering voltage until the firing device has fired;
- and
- providing an actuation voltage in order to actuate the closure device.