Is Pornography Haram?
purification of thought is also required and yes, it is a preventive measure.