At the end, Dancy shot himself by a pistol. He does this to save his honour.
Mabel represents the noblest form of wifely loyalty to her husband. She knows her that her husband had married her without telling her about his earlier love affair. She knows that he has stolen money and has been deceiving her all along. Even then her loyalty remains firm as a rock. Under no circumstances would she desert him.
Dancy is loyal to his own conception of a manly, adventurous dare-devil type of life. He wants to live dangerously. That is why he took the risk of jumping from one balcony to the other twice. That also explains why he shot himself when he was trapped.