This is an appeal by a tenant from a judgment for possession and an order to release to the landlord funds held in the court Registry under a protective order.
Landlord Norman Lee Barnes gave his tenant, Myrtle Goodwin, 90 days’ notice to quit the premises. When Goodwin failed to quit, Barnes brought an action for possession and obtained a protective order requiring the tenant to pay her rent into the court Registry. Goodwin’s answer alleged that her landlord sought a retaliatory eviction because she had complained repeatedly of housing code violations.
At a hearing on the action for possession, counsel stipulated that Goodwin had vacated the premises and insisted that the complaint be dismissed for mootness based on that fact. The trial judge chose instead to enter a judgment for possession, expressing skepticism that Goodwin had, in fact, vacated.
When Goodwin’s counsel asked for a McNeal hearing, i.e., an evidentiary hearing on the issue of how the funds held in the court Registry were to be disbursed, the trial judge granted the request. The court, *1247however, then ordered the release to the landlord of the funds without the hearing. No evidentiary hearing was ever held.
Appellant challenges both the judgment for possession and the disbursement order. We hold that the trial court erred as to both orders and remand with instructions to dismiss the action for possession and to hold a McNeal hearing.
Appellant questions the correctness of the judgment for possession on the basis of Atkins v. United States, 283 A.2d 204 (D.C.1971). In that.'.case, the issue was whether a landlord’s action for possession became moot where counsel represented that the tenants had vacated and counsel for the tenants moved to dismiss the complaints for mootness. This court, reversing the judgment of the trial court, held that the voluntary surrender of the premises made the complaint moot. Id. at 205. The court remanded with instructions to dismiss, saying:
[T]he formal request by appellant’s counsel in open court to dismiss the case as moot was sufficient, taken with appellant’s departure from the leased premises, to constitute a voluntary surrender of the premises and an unequivocal acknowledgment of their landlord’s right to possession.
Id. at 206.
The result in Atkins is consistent with our more recent decision in McNeal v. Habib, 346 A.2d 508 (D.C.1975). McNeal also involved the appeal of a judgment for possession as well as an order to disburse funds held pursuant to a protective order. This court stated that where the tenant “voluntarily surrendered possession of the premises, [she] thereby moot[ed] the possessory action.” Id. at 510.
Thus, under Atkins and McNeal, the trial court in this case erred. Accordingly, we reverse the judgment for possession and remand with instructions to dismiss as moot the landlord’s action.
Appellant further claims that under McNeal v. Habib, supra, the trial court erred in disbursing the funds held in the court Registry without holding an eviden-tiary hearing. We agree. As stated above, McNeal involved an appeal from a judgment for possession and an order for disbursement of funds. We held, inter alia, that the trial court’s action as to the disbursement was improper because there had been no evidentiary hearing as to what portion of the funds properly belonged to each party. McNeal, supra, 346 A.2d at 514. The rationale for requiring such a hearing was that the tenant had raised at trial the defenses of housing code violations and retaliatory eviction. The hearing in McNeal was specifically mandated to allow the presentation of evidence of housing code violations which, while
irrelevant to the 30-day notice to quit, ... may well have significance as to the post-return date payment for the tenant’s use and occupancy of the premises pending the conclusion of the proceeding.
Id. at 514.
That the hearing is solely for the purpose of examining evidence of housing code violations or other defects was made clear in this court’s recent explanation of McNeal in Dameron v. Capitol House Associates, Ltd., 431 A.2d 580 (D.C.1981). There the court stated:
The evidentiary hearing which appellants seek is only appropriate at the conclusion of the suit for possession if the trial of the case, itself, does not determine the proportionate rights of the parties. In McNeal v. Habib, supra, the action for possession became moot and the trial judge erroneously released the funds to the landlord without holding the necessary hearing. On appeal, we held that a hearing was required at the termination of the controversy to determine the abatement, if any, to which the tenant was entitled depending on evidence of housing code violations, further defects appearing during the course of litigation, and the length of time during which the *1248tenant held over denying the landlord productive use of the property.
Id. at 583-84.
In this case, appellant raised the issues of housing code violations and retaliatory eviction in her answer. Thus, the trial court was on notice that habitability was an issue and, under McNeal, was required, not simply to order a hearing, but to hold one before ordering disbursement of the funds. The court’s failure to hold an evidentiary hearing was error. We reverse and remand with instructions to hold a McNeal hearing.1
So ordered.
. Our dissenting colleague maintains that because appellant was on notice of her landlord’s request for release of the funds in the registry but failed to present any evidence of housing code violations, we should affirm the order disbursing those funds. We cannot agree. Whether appellant’s counsel did or did not present any evidence at the May 3 hearing is really beside the point. Once the money came into the court’s control by being deposited in the registry, the court had an independent duty to ensure that it was properly distributed. Its performance of that duty could not be affected by any act or omission of either party. Even if both counsel had stood mute, the court would have had an affirmative obligation to hold a McNeal hearing, given that a defense of housing code violations had been raised. To hold otherwise would eviscerate McNeal.