When I made that commit, there was code in DOSBox-X still that liked to shutdown and restart SDL's video subsystem (for reasons that may have something to do with historical SDL 1.x bugs, I guess). Waiting until SDL_Quit to shut down the parent window prevents the parent window from flickering on the screen for each time that is done.
On Windows, doing that would sometimes cause Windows to restore the window behind another application, whenever output=opengl, which is annoying.
I had a similar problem on Linux where if output=opengl, any change including bringing up the mapper would cause the X11 window manager to move the window to the upper left hand corner, no matter how many times I moved it back, which was also annoying.
DOSBox-X project: more emulation better accuracy.
DOSLIB and DOSLIB2: Learn how to tinker and hack hardware and software from DOS.