The code that you gave doesn't compile, as the compiler complains about deleting non-pointers.
but the following code:
int main()
{
int *p;
delete p;
}
gets the same error message that I get.
EDIT:
I looked through the source. The sf::Window class, which sf::RenderWindow inherits from, does call Close() at its destructor. But constructors and destructors aren't inherited, right? Anyways, the destructor for a RenderWindow is this:
RenderWindow::~RenderWindow()
{
// Nothing to do...
}
The Close() is not called when I use RenderWindows like in the example I posted near the top, so it shouldn't be causing the error.
EDIT2:
Man, I feel stupid. Apparently, destructors are called from the base class as well, just after the constructor for the class that is inheriting. So, RenderWindow's destructor runs, and then Window's destructor runs, when the object is destroyed. So Close() is called, after all, in the destruction process.