Billy Bob Wegenhoft died at the age of 90 years old. He was survived by his wife and three children: Carl William Wegenhoft, Curtis Edward Wegenhoft, and Cynthia Wegenhoft Moran. Carl initiated this proceeding to probate Billy Bob’s will, which contained a no-contest clause. Curtis and Cynthia filed their opposition to the will, asserting that Billy Bob executed the will under undue influence by Carl, but they nonsuited their claims on the eve of trial. The trial court permitted Carl’s claims concerning suitability and enforcement of the no-contest clause to proceed to trial and ultimately rendered judgment in favor of Carl. Curtis and Cynthia bring this appeal challenging the trial court’s subject matter jurisdiction to enter judgment against them when they nonsuited their contest prior to trial. We reverse and remand. Background Billy Bob executed his last will and testament on November 13, 2013, revoking all wills and codicils previously made. Under the will, Billy Bob’s wife and three children were named as beneficiaries. He passed away on January 21, 2020. On April 3, 2020, Carl filed an application to probate the 2013 Will. In his application, Carl indicated that Billy Bob named his wife as independent executor, but she was unable to serve due to memory issues. Carl requested that he be appointed executor, alleging that his siblings were precluded because they were challenging the will (even though Curtis and Cynthia had not yet opposed the admission of the 2013 Will at this time). In response to Carl’s application, Curtis and Cynthia filed their opposition to the admission of the 2013 Will, asserting that Billy Bob executed the will under undue influence by Carl. They requested that the trial court determine the validity of the 2013 Will, sought declaratory relief declaring the will void, and requested an accounting of Carl’s conduct as power of attorney. Carl then filed a motion, claiming, among other things, that Curtis and Cynthia were unsuitable to serve as executors, did not have standing to request an accounting, and had forfeited all benefits by challenging the validity of the 2013 Will. Curtis and Cynthia later amended their contest to include a counterapplication to probate the will executed by Billy Bob on May 25, 1989, maintaining that the 2013 Will was invalid. Carl filed an amended answer to the counterapplication, contesting the 1989 Will and re- asserting his suitability and no-contest claims. For a period of three years, the parties filed additional pleadings and conducted extensive discovery. Outside of Carl’s response to his siblings’ opposition and amended answer to his siblings’ counterapplication, he did not seek declaratory relief or otherwise assert an independent action concerning his suitability and no-contest claims. The case was eventually set for trial on April 10, 2023. Three days prior to trial, Curtis and Cynthia nonsuited their contest in its entirety, indicating that they filed their pleadings in good faith but no longer wished to pursue their claims. The trial court entered a partial judgment admitting the 2013 Will to probate and finding Carl suitable to serve as independent executor. Over Curtis and Cynthia’s objection that the trial court lacked subject matter jurisdiction to decide any outstanding claims alleged by Carl in his amended answer, the case proceeded to trial. At the conclusion of the trial, the trial court signed two separate judgments, declaring that the no- contest clause was appropriate and warranted, and Curtis and Cynthia were unsuitable to serve as executors. The trial court ordered that Curtis and Cynthia be treated as if they predeceased Billy Bob. Discussion As their only issue, Curtis and Cynthia argue that the trial court lacked subject matter jurisdiction to render judgment concerning enforcement of the no-contest clause and suitability to serve as executors. According to Curtis and Cynthia, the nonsuit was effective immediately and rendered all contested issues moot, including Carl’s claims asserted in his amended answer. Carl claims that even though Curtis and Cynthia abandoned their will contest, the trial court retained subject matter jurisdiction because he “affirmatively pled” for enforcement of the no-contest clause and for a finding of unsuitability. Resolution of this appeal turns on the existence or absence of subject matter jurisdiction. Thus, we must determine whether the claims asserted by Carl in his amended answer are claims for affirmative relief that survived Curtis and Cynthia’s nonsuit. Tex. R. Civ. P. 162 (“Any dismissal pursuant to this rule shall not prejudice the right of an adverse party to be heard on a pending claim for affirmative relief.”). If they are, then the trial court properly retained subject matter jurisdiction to decide the remaining issues raised by Carl. But, if they are not, then the trial court erred in exercising subject matter jurisdiction. Whether a trial court has subject matter jurisdiction is a matter of law that is reviewed de novo. Tex. Dep’t of Parks & Wildlife v. Miranda, 133 S.W.3d 217, 226, 228 (Tex. 2004). Texas Rule of Civil Procedure 162 provides that a plaintiff may take a nonsuit at any time before introducing all of his evidence other than rebuttal evidence. Tex. R. Civ. P. 162. A plaintiff’s nonsuit is effective immediately upon filing. Travelers Ins. Co. v. Joachim, 315 S.W.3d 860, 862–63 (Tex. 2010). A trial court’s granting of a nonsuit is a ministerial act. In re Greater Hous. Orthopaedic Specialists, Inc., 295 S.W.3d 323, 325 (Tex. 2009) (orig. proceeding); Greenberg v. Brookshire, 640 S.W.2d 870, 871 (Tex. 1982). A trial court generally has no discretion to refuse to sign an order for dismissal once notice of nonsuit has been filed. In re Bennett, 960 S.W.2d 35, 38 (Tex. 1997). However, rule 162 expressly limits the right to nonsuit an entire cause when the defendant has a claim for affirmative relief pending. Tex. R. Civ. P. 162 (providing that a nonsuit “shall not prejudice the right of an adverse party to be heard on a pending claim for affirmative relief”); see also Bennett, 960 S.W.2d at 38. A claim for affirmative relief is one “on which the claimant could recover compensation or relief even if the plaintiff abandons his cause of action.” Tex. Mut. Ins. Co. v. Ledbetter, 251 S.W.3d 31, 38 (Tex. 2008) (quoting Univ. of Tex. Med. Branch at Galveston v. Est. of Blackmon ex rel. Shultz, 195 S.W.3d 98, 101 (Tex. 2006)) (punctuation omitted). Therefore, while a nonsuit has the effect of terminating a case from the moment the motion is filed, it does not affect the right of an adverse party to be heard on a pending claim for affirmative relief. N. Star Water Logic, LLC v. Ecolotron, Inc., 486 S.W.3d 102, 106 (Tex. App.—Houston [14th Dist.] 2016, no pet.). In other words, “[p]arties have an absolute right to nonsuit their own claims, but not someone else’s claims they are trying to avoid.” Ledbetter, 251 S.W.3d at 37 (citation omitted) (emphasis in original). As a brief recap, Curtis and Cynthia opposed the admission of the 2013 Will and filed a counter application to probate the 1989 Will. Carl filed a motion alleging that his siblings violated the no-contest clause and requested a finding that they were unsuitable to serve as executors. He also re-asserted these claims in an amended answer to his siblings’ counterapplication. Before the case proceeded to trial, Curtis and Cynthia filed their notice of nonsuit, thereby abandoning their will contest and counterapplication. Accordingly, the only live pleading remaining was Carl’s application to probate the 2013 Will. We cannot agree that Carl’s claims asserted in his motion or amended answer survived the nonsuit because his claims did not constitute an independent claim for affirmative relief. Gen. Land Office v. Oxy U.S.A., Inc., 789 S.W.2d 569, 570 (Tex. 1990) (“To qualify as a claim for affirmative relief, a defensive pleading must allege that the defendant has a cause of action, independent of the plaintiff’s claim, on which he could recover benefits, compensation or relief, even though the plaintiff may abandon his cause of action or fail to establish it.”) (quoting Weaver v. Jock, 717 S.W.2d 654, 657 (Tex. App.—Waco 1986, writ ref’d n.r.e.). Put another way, the nonsuit rendered Carl’s claims moot because his claims were dependent on his siblings’ will contest and counterapplication. Without the contest or counterapplication, Carl could not possibly seek to enforce his claims. See generally Joachim, 315 S.W.3d at 862 (nonsuit renders merits of nonsuited case moot). Though Carl relies heavily on In re Estate of Gibbons to argue otherwise, we are not persuaded that this case supports his position because he did not seek declaratory relief in his application to probate the 2013 Will. 451 S.W.3d 115, 122 (Tex. App.—Houston [14th Dist.] 2014, pet. denied) (providing that the contestants’ nonsuit of any claims asserted by them did not prejudice the testatrix’s husband’s right to pursue his pending claims for declaratory relief regarding the will’s no- contest clause). Contrary to Gibbons, Carl’s application only requested probate of the 2013 Will and that he be appointed as executor. Carl has not cited (and research has not revealed) any Texas case in which a court retained jurisdiction after a nonsuit over claims asserted in an answer when the claims did not seek affirmative relief.[1] Accordingly, Carl’s claims were extinguished by the nonsuit because he did not have a pending claim for affirmative relief. See Tex. R. Civ. P. 162; Ledbetter, 251 S.W.3d at 38. We sustain the issue raised on appeal. Conclusion We conclude that the trial court erred in exercising subject matter jurisdiction over Carl’s claims after Curtis and Cynthia nonsuited their will contest and counterapplication. We therefore vacate the trial court’s judgments entered on April 26, 2023, and remand for entry of a final judgment consistent with this opinion. Frances Bourliot Justice Panel consists of Justices Wise, Bourliot, and Wilson.