forked from aniani/vim
patch 8.1.0300: the old window title might be freed twice
Problem: The old window title might be freed twice. (Dominique Pelle) Solution: Do not free "oldtitle" in a signal handler but set a flag to have it freed later.
This commit is contained in:
parent
142ae736d9
commit
d8f0cef2bd
@ -161,6 +161,7 @@ static int get_x11_title(int);
|
|||||||
static int get_x11_icon(int);
|
static int get_x11_icon(int);
|
||||||
|
|
||||||
static char_u *oldtitle = NULL;
|
static char_u *oldtitle = NULL;
|
||||||
|
static volatile int oldtitle_outdated = FALSE;
|
||||||
static int did_set_title = FALSE;
|
static int did_set_title = FALSE;
|
||||||
static char_u *oldicon = NULL;
|
static char_u *oldicon = NULL;
|
||||||
static int did_set_icon = FALSE;
|
static int did_set_icon = FALSE;
|
||||||
@ -1231,8 +1232,9 @@ deathtrap SIGDEFARG(sigarg)
|
|||||||
after_sigcont(void)
|
after_sigcont(void)
|
||||||
{
|
{
|
||||||
# ifdef FEAT_TITLE
|
# ifdef FEAT_TITLE
|
||||||
// Set oldtitle to NULL, so the current title is obtained again.
|
// Don't change "oldtitle" in a signal handler, set a flag to obtain it
|
||||||
VIM_CLEAR(oldtitle);
|
// again later.
|
||||||
|
oldtitle_outdated = TRUE;
|
||||||
# endif
|
# endif
|
||||||
settmode(TMODE_RAW);
|
settmode(TMODE_RAW);
|
||||||
need_check_timestamps = TRUE;
|
need_check_timestamps = TRUE;
|
||||||
@ -2281,6 +2283,11 @@ mch_settitle(char_u *title, char_u *icon)
|
|||||||
*/
|
*/
|
||||||
if ((type || *T_TS != NUL) && title != NULL)
|
if ((type || *T_TS != NUL) && title != NULL)
|
||||||
{
|
{
|
||||||
|
if (oldtitle_outdated)
|
||||||
|
{
|
||||||
|
oldtitle_outdated = FALSE;
|
||||||
|
VIM_CLEAR(oldtitle);
|
||||||
|
}
|
||||||
if (oldtitle == NULL
|
if (oldtitle == NULL
|
||||||
#ifdef FEAT_GUI
|
#ifdef FEAT_GUI
|
||||||
&& !gui.in_use
|
&& !gui.in_use
|
||||||
|
@ -794,6 +794,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
300,
|
||||||
/**/
|
/**/
|
||||||
299,
|
299,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user