(a) By attorney general. – The attorney general may without leave of the court file a dismissal of an indictment, information or complaint and the prosecution shall thereupon terminate. Such a dismissal may not be filed during the trial without the consent of the defendant or after conviction without leave of the court.(b) By court. – If there is unnecessary delay in presenting the charge to a grand jury or in filing an information against a defendant who has been held to answer in Superior Court, or if there is unnecessary delay in bringing a defendant to trial, the court may dismiss the indictment, information or complaint.