Walden and Alan's marriage will come to an end in the next episode of "Two and a Half Men" on Thursday.

In last week's episode, Walden contemplated staying in a relationship with Ms. McMartin in order to ensure that he would be able to adopt Louis. However, he felt bad about leading her on and decide to be honest about his feelings and break up with her, reports Entertainment Weekly.

He planned to give Ms. McMartin a breakup speech when she stopped by his home, but before he could begin, the social worker questioned if he was being authentic in their relationship. That's when he told her the truth about why he continued to date her. In response, she assured him that their break up would not affect his ability to officially adopt Louis before she handed him the final paperwork.

Although Walden was ecstatic after he adopted Louis, he realized that he had no real reason to break up with Ms. McMartin. He also realized that he would end up stuck with Alan if he didn't find a spouse. Likewise, Alan came to the realization that he should not have broken up with Lyndsey when she asked him to move in with her.

At the end, the two roommates made desperate attempts to rekindle their relationships with their love interests.

The synopsis of the next episode, entitled "Don't Give a Monkey a Gun," reveals that Alan and Walden will finalize their divorce.

"After they sign their divorce papers, Walden offers Alan the gift of his choice, but when Alan chooses something selfish and impractical, it puts his relationship with Lyndsey on the line," reads the synopsis, according to Carter Matt.

Maggie Lawson will also return in as Ms. McMartin while Michael Bolton will make another cameo as himself.

There are also more clues that Charlie Sheen will return in the two-part series finale on Feb. 19.

The titled of the episode, "Of Course He's Dead - Part One and Part Two," may be a reference to Sheen's character, Charlie Harper, who was killed off the popular sitcom in 2011 after Sheen was fired for publicly bashing the show's executive producer, Chuck Lorre. Sheen also filed a lawsuit against Lorre, the network and Warner Brother, the studio behind the show. The leading role was then replaced by Ashton Kutcher.

Last month, Lorre revealed that there is a possibility Sheen will appear in the finale. He also told reporters that he has "nothing but good feelings about those eight and half years" he worked with the actor," reports People magazine.

"The show has morphed into something else entirely for the last four years to something we love," added Lorre, in reference to the casting of Ashton Kutcher. "How to honor both [eras] is the challenge of this finale, and the other challenge [is] how to get people to watch it without telling them what it is."

Season 12, Episode 14 of "Two and a Half Men," "Don't Give a Monkey a Gun," will air on Thursday, Feb. 12 on CBS.

Watch a preview below.