The state, or the county in which the offense was committed or is triable, according to the nature of the offense, pays the costs accrued on behalf of the state, and for which the state or county is liable under § 40-25-129, in the following cases, when:
(1) The defendant is acquitted by a verdict of the jury upon the merits;(2) The prosecution is dismissed, or a nolle prosequi entered by the state;(3) The action has abated by the death of the defendant;(4) The defendant is discharged by the court or magistrate before indictment preferred or found, or after indictment and before verdict; or(5) The defendant has been convicted, but the execution issued upon the judgment has been returned "nulla bona" or where the court hearing the case has made a finding at any evidentiary hearing that the defendant is indigent and remains indigent at the time of conviction.Code 1858, § 5585 (deriv. Acts 1813, ch. 137 (136 in Scott's Revisal), §§ 2, 3, 5; 1832, ch. 8, § 2; 1837-1838, ch. 141, § 1; 1853-1854, ch. 38, § 1; 1853-1854, ch. 72, §2); Acts 1885 (Ex. Sess.), ch. 14; 1897, ch. 20, § 1; Shan., § 7619; Code 1932, §12247; Acts 1980, ch. 625, § 2; T.C.A. (orig. ed.), § 40-3332.