Should I use SDL_Quit() even after a failed initialisation?
<p>When using SDL2.0, is it reasonable to stop the program without using SDL_Quit() if SDL could not create the window or the renderer ?</p>

<p>For example, can I write (after the SDL initialisation, the window and the renderer creation):</p>

<pre><code>if (!renderer)
{
    fprintf("Error while creating the renderer: %s\n", SDL_GetError());
    return -1;
}

SDL_DestroyWindow(window);
IMG_Quit();
SDL_Quit();
return 0;
</code></pre>

<p>Or should I write :</p>

<pre><code>if (!renderer)
{
    fprintf("Error while creating the renderer: %s\n", SDL_GetError());
    SDL_DestroyWindow(window);
    SDL_Quit();
    return -1;
}

SDL_DestroyWindow(window);
IMG_Quit();
SDL_Quit();
return 0;
</code></pre>

<p>I think the second choice is better, but I'm not sure that it is really useful to close the SDL and to destroy the window even when the renderer wasn't created.</p>