Check for hidden dirty child on close

Fixes: #11405
This commit is contained in:
Juergen Spitzmueller 2018-12-17 09:11:34 +01:00
parent ab5c08b3f0
commit f87218bbb5

View File

@ -3069,9 +3069,13 @@ bool GuiView::closeBuffer(Buffer & buf)
break;
} else {
// In this case the child buffer is open but hidden.
// It therefore should not (MUST NOT) be dirty!
LATTEST(child_buf->isClean());
theBufferList().release(child_buf);
// Even in this case, children can be dirty (e.g.,
// after a label change in the master, see #11405).
// Therefore, check this.
if (saveBufferIfNeeded(*child_buf, false)) {
child_buf->removeAutosaveFile();
theBufferList().release(child_buf);
}
}
}
}