The invention relates to a system for locking a detachable cartridge (130) in a housing (100). The system includes a movable member for closing and/or opening one and/or a plurality of openings (260a, 260b) of the cartridge (130), and a releasing mechanism (250) for allowing detachment of the cartridge (130) from the housing (100) during actuation, wherein the movable member is configured to prevent actuation of the releasing mechanism (250), i.e., prevent detachment of the cartridge (130) from the housing (100).