
154 S.E.2d 327 (1967)
270 N.C. 180
In the Matter of the Custody of Harvin Austin SAULS, III.
No. 538.
Supreme Court of North Carolina.
May 3, 1967.
*330 Robert L. Scott, Charlotte, for Harvin Austin Sauls, Jr., petitioner appellee.
Lucas, Rand, Rose, Morris & Meyer, Wilson, Coble, Tanner & Grigg, Albemarle, Ruff, Perry, Bond, Cobb & Wade, Charlotte, for Dorothy Wheeler Sauls, respondent appellant.
SHARP, Justice.
The rights of the parties to this controversy have become embogged in a procedural quagmire. As a result, we have the anomalous situation in which petitioner, in his answer to the Wilson County divorce action, pleads respondent's departure from his home in Albemarle on 21 September 1965 as an abandonment which defeats her suit, while the judge presiding in Stanly County denies her motion to dismiss the habeas corpus proceeding pending there because no resumption of marital relations has been shown. It would seem that an unconditional, bona fide resumption of marital relations, if such has occurred, would have vacated any order of custody then in force. Certainly it would destroy the status which, in the beginning, gave the court jurisdiction to issue the writ under G.S. § 17-39. See Hester v. Hester, 239 N.C. 97, 79 S.E.2d 248. We need not, however, pick our way through the procedural quicksands to reach that problem because, in limine, we are here confronted by this question: Was the custody jurisdiction which the Superior Court of Stanly County had previously acquired under G.S. § 17-39 ousted by the institution of the divorce action in the Superior Court of Wilson County? In pertinent part, G.S. § 17-39 provides:
"When a contest shall arise on a writ of habeas corpus between any husband or wife, who are living in a state of separation, without being divorced, in respect to the custody of their children, the court or judge, on the return of such writ, may award the charge or custody of the child or children so brought before it either to the husband or to the wife, for such time, under such regulations and restrictions, and with such provisions and directions as will, in the opinion of such court or judge, best promote the interest and welfare of the children. At any time after the making of such orders the court or judge may, on good cause shown, annul, vary or modify the same * * *."
G.S. § 17-39.1, enacted on 7 May 1957, as Chapter 545 of the Session Laws of 1957, provides:
"In addition to the above mandatory section (G.S. § 17-39) and other methods authorized by law for determining the custody of minor children, any superior court judge having authority to determine matters in chambers in the district may, in his discretion, issue a writ of habeas corpus requiring that the body of any minor child whose custody is in dispute be brought before him or any other qualified judge. Upon the return of said writ the judge may award the charge or custody of the child to such person, organization, agency or institution for such time, under such regulations and restrictions, and with such provisions and directions, as will, in the opinion of the judge, best promote the interest and welfare of said child. The cause may be retained for the purpose of *331 varying, modifying or annulling any order for cause at any subsequent time."
Prior to the enactment of G.S. § 17-39.1, the decisions of this Court made it quite clear that immediately upon the institution of an action for divorce, either absolute or a mensa et thoro, jurisdiction of the custody of the parties previously acquired under G.S. § 17-39 was ousted and vested in the court in which the divorce action was pending. G.S. § 50-13. The rule was succinctly stated by Barnhill, J. (later C. J.), in Phipps v. Vannoy, 229 N.C. 629, 632, 50 S.E.2d 906, 907-908:
"So soon as the `state of separation' between husband and wife resolves itself into, brings about, or is followed by an action for divorce in which a complaint has been filed, the jurisdiction of the court acquired under a writ of habeas corpus as provided by G.S. § 17-39 is ousted and authority to provide for the custody of the children of the marriage vests in the court in which the divorce proceeding is pending. Robbins v. Robbins, 229 N.C. 430, 50 S.E.2d 183; In re Blake, supra [184 N.C. 278, 14 S.E. 294]; McEachern v. McEachern, supra [210 N.C. 98, 185 S.E. 684]; In re Albertson, supra [205 N.C. 742, 172 S.E. 411]; Tyner v. Tyner, 206 N.C. 776, 175 S.E. 144; Story v. Story, 221 N.C. 114, 19 S.E. 2d 136. Jurisdiction rests in this court so long as the action is pending and it is pending for this purpose until the death of one of the parties.
"When, however, the parents were divorced outside this State, either parent may have the question of custody as between them determined in a special proceeding in the Superior Court. G.S. § 50-13."
Accord, Swicegood v. Swicegood, N.C., 154 S.E.2d 324; Weddington v. Weddington, 243 N.C. 702, 92 S.E.2d 71; 3 Lee, N.C. Family Law § 222 (3d Ed., 1963).
Did the enactment of G.S. § 17-39.1 change this well established rule and authorize the judge, in his discretion, to use habeas corpus as an alternative or additional remedy to all other authorized methods for determining custody, including actions for divorce? See 36 N.C.L.Rev. 52, 53 (1957).
In Cox v. Cox, 246 N.C. 528, 530, 98 S.E.2d 879, 882, decided June 28, 1957 approximately two months after the passage of G.S. § 17-39.1, this Court said:
"When a divorce action is instituted, jurisdiction over the custody of the children born of the marriage vests exclusively in the court before whom the divorce action is pending and becomes a concomitant part of the subject matter of the court's jurisdiction in the divorce action. G.S. § 50-13." (Emphasis added.)
In Cleeland v. Cleeland, 249 N.C. 16, 18, 105 S.E.2d 114, 116, petitioner and respondent had been divorced in Virginia. Respondent, a resident of North Carolina, had custody of the children of the marriage. Petitioner, a resident of California, came to North Carolina and filed a petition for habeas corpus to obtain their custody. It was held that habeas corpus was an available remedy, and this statement appears in the opinion:
"Prior to 1957 habeas corpus could not be used to determine the right to the custody of children whose parents had been divorced, In re McCormick, 240 N.C. 468, 82 S.E.2d 406; but by legislative act, c. 545, S.L.1957, G.S. § 17-39.1, the marital status of parents is not now a factor in determining the procedure to obtain custody of a child."
In In re Herring, 268 N.C. 434, 435, 150 S.E.2d 775, 777, a case in which grandmothers were contending for the custody of their orphan grandchild, it is said: "The statute quoted above (G.S. § 17-39.1) was enacted for the purpose of giving Judges of the Superior Courts authority to hear and determine the custody of infants in all cases and without regard to previous proceedings."
*332 Other cases in which G.S. § 17-39.1 has provided the remedy to determine custody are: In re Craigo, 266 N.C. 92, 145 S.E.2d 376 (custody of the children of contending parents divorced outside of North Carolina awarded to the maternal grandparents); In re Skipper, 261 N.C. 592, 135 S.E.2d 671 (dispute over children in North Carolina between parents with divorce action pending in South Carolina); Murphy v. Murphy, 261 N.C. 95, 134 S.E.2d 148 (Plaintiff-wife, living apart from defendant-husband under a deed of separation, sued for breach of the support agreement, custody, and support for the minor children. She stated no cause of action for divorce or alimony without divorce. Held, notwithstanding, she had stated a cause for breach of contract, and "[a] habeas corpus proceeding is also available to plaintiff. G.S. § 17-39, G.S. § 17-39.1." The court could "treat the complaint as a petition for writ of habeas corpus and proceed accordingly."); Spitzer v. Lewark, 259 N.C. 50, 129 S.E.2d 620 (dispute between the parents of an infant and its paternal grandparents); Lennon v. Lennon, 252 N.C. 659, 114 S.E.2d 571 (dispute between parents, one a resident of North Carolina, the other a nonresident divorced in Nevada).
We have found no case decided since the passage of G.S. § 17-39.1 in which custody has been adjudicated in a habeas corpus proceeding after a divorce action has been instituted. The statements quoted above from Cleeland and from In re Herring were too broad and are hereby disapproved to the extent that they conflict with the rule that the institution of a divorce action ousts custody jurisdiction acquired under habeas corpus. To hold that with the enactment of G.S. § 17-39.1 the legislature gave the judge presiding in the district the discretion to issue a writ of habeas corpus and to hear and determine the custody of all infants, without regard to previous decisions relating to their custody, would make a shambles of the statutes relating to custody. G.S. § 7-103 (c); G.S. § 17-39; G.S. § 17-39.1; G.S. § 50-13; G.S. § 50-16; G.S. § 110-21(3). Ipsissimis verbis, some of those statutes are conflicting and inconsistent, and this Court, from time to time, has labored hard to reconcile or harmonize them. See Blankenship v. Blankenship, 256 N.C. 638, 124 S.E.2d 857; In re Cranford, 231 N.C. 91, 56 S.E.2d 35; Phipps v. Vannoy, supra; In re Hamilton, 182 N.C. 44, 108 S.E. 385. Yet one must read the cases to find that "exclusive original jurisdiction" does not mean what it says in G.S. § 110-21.
The filing of an action for divorce, either absolute or a mensa et thoro, abrogates the necessity for habeas corpus to determine custody, for the court, in its equitable jurisdiction, has the inherent power to order the children of the parties brought before it. Bunn v. Bunn, 258 N.C. 445, 128 S.E.2d 792, 7 A.L.R.3d 1088. In divorce actions, the marital rights and obligations of both husband and wife, as well as the custody and support of the children of the marriage, are before the court in a single action. In a habeas corpus proceeding, the judge has jurisdiction of only one facet of the marital dispute, the custody and support of the children. When, as here, the right of the wife to support as well as to custody is at issue, justice to all partiesparticularly the husband-father is best served when one judge is able to see the controversy whole and to deal with all the financial problems which it creates.
In this case, alimony pendente lite has been awarded respondent in Wilson County. There is at present no support order in the habeas corpus proceeding in Stanly County. Conceding, arguendo, that custody could be awarded respondent in that proceeding, the judge there would then be called upon to fix the amount which petitioner should pay her for the child's support.
We are constrained to believe that the legislature did not intend habeas corpus under G.S. § 17-39.1 to be used to determine custody disputes between parents divorced *333 in North Carolina or between whom a divorce action is pending, but that this section provides an alternate remedy (to be used in the judge's discretion) in other cases. We hold, therefore, that the institution of a divorce action in this State ousts the custody jurisdiction previously obtained under a writ of habeas corpus, whether it be issued under G.S. § 17-39 or G.S. § 17-39.1. We note, however, that the general rule that exclusive custody jurisdiction is vested in the divorce court is subject to an exception. It was held in Blankenship v. Blankenship, supra, that a court before which an action for alimony without divorce (G.S. § 50-16) was pending did not lose its custody jurisdiction to the court of another county in which an action for divorce had been subsequently filed. It was there pointed out that prior to the 1953 and 1955 amendments to G.S. § 50-16, this Court had uniformly held that the court in which a divorce action was instituted obtained and retained exclusive jurisdiction over the custody of the children of the marriage as long as both parties lived and that, until the 1953 amendment to G.S. § 50-16, custody of children could not be determined in an action for alimony without divorce. Blankenship holds that G.S. § 50-16 created an additional method whereby all questions relating to custody and child support are brought into and determined in the suit for alimony, that is, in one action. This decision was bolstered by the 1955 amendment to the statute, which provided that custody orders were authorized in actions under G.S. § 50-16 "in the same manner as such orders are entered by the court in an action for divorce." It noted, however, that, if the divorce action had been first instituted, the court in which that action was pending would have acquired exclusive jurisdiction. For a comment on Blankenship, see 47 N.C.L.Rev. 464 (1963).
Respondent did not lose her right to challenge the custody jurisdiction of the Superior Court of Stanly County by failing to appeal from the order entered by Judge Olive on 26 October 1966. "Jurisdiction over the subject matter cannot be conferred upon a court by consent, waiver or estoppel, and therefore failure to demur or object to the jurisdiction is immaterial." 1 Strong, N.C. Index, Courts § 2 (1957); Hart v. Thomasville Motors, 244 N.C. 84, 92 S.E.2d 673; State ex rel. Hanson v. Yandle, 235 N.C. 532, 70 S.E.2d 565.
The order of Olive, J., dated 26 October 1966, and the order of McLaughlin, J., dated 29 December 1966, are reversed, and this cause is remanded to the Superior Court of Stanly County, which is directed to enter an order dismissing the habeas corpus proceeding from the docket.
Reversed.
