Skip to content

Commit

Permalink
patch 7.4.1598
Browse files Browse the repository at this point in the history
Problem:    When starting the GUI fails a swap file is left behind. (Joerg
            Plate)
Solution:   Preserve files before exiting. (closes #692)
  • Loading branch information
brammool committed Mar 19, 2016
1 parent 9f6154f commit 6d8d849
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/gui.c
Expand Up @@ -105,7 +105,7 @@ gui_start(void)
/* If there is 'f' in 'guioptions' and specify -g argument,
* gui_mch_init_check() was not called yet. */
if (gui_mch_init_check() != OK)
exit(1);
getout_preserve_modified(1);
#endif
gui_attempt_start();
}
Expand Down Expand Up @@ -272,7 +272,7 @@ gui_do_fork(void)
#ifdef FEAT_GUI_GTK
/* Call gtk_init_check() here after fork(). See gui_init_check(). */
if (gui_mch_init_check() != OK)
exit(1);
getout_preserve_modified(1);
#endif

# if defined(HAVE_SETSID) || defined(HAVE_SETPGID)
Expand Down Expand Up @@ -309,7 +309,7 @@ gui_do_fork(void)

/* If we failed to start the GUI, exit now. */
if (!gui.in_use)
exit(1);
getout_preserve_modified(1);
}

/*
Expand Down
6 changes: 4 additions & 2 deletions src/main.c
Expand Up @@ -1355,7 +1355,7 @@ main_loop(
}


#if defined(USE_XSMP) || defined(FEAT_GUI_MSWIN) || defined(PROTO)
#if defined(USE_XSMP) || defined(FEAT_GUI) || defined(PROTO)
/*
* Exit, but leave behind swap files for modified buffers.
*/
Expand All @@ -1377,7 +1377,9 @@ getout_preserve_modified(int exitval)
#endif


/* Exit properly */
/*
* Exit properly.
*/
void
getout(int exitval)
{
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -748,6 +748,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1598,
/**/
1597,
/**/
Expand Down

0 comments on commit 6d8d849

Please sign in to comment.