How to override closeButtonPressed() in a DialogWindow?

I have a class that inherits from DialogWindow which I am using to open a modal pop-up window using DialogWindow::LaunchOptions. I would like pressing the pop-up window’s close button to delete the window, not just hide it. I tried overriding closeButtonPressed() in my derived class, but it does not get called when I press the close button.

In juce_DialogWindow.cpp there is a class called DefaultDialogWindow and it also overrides closeButtonPressed(). This method is the one that actually gets called. I thought maybe I should inherit from this class instead, but that doesn’t seem to be possible. Any suggestions as to how I can override it’s closeButtonPressed() method or a different approach I should use?