(6)Where the compounding of any offence is made after the institution of any prosecution, such compounding shall be brought to the notice of the court in which the prosecution is pending in writing by the officer referred to in sub-section (1), and on such notice of the compounding of the offence being given to the court, the person against whom the offence is so compounded shall be discharged.