diff options
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/buffer.c b/src/buffer.c index c017db7b034..06d385110c6 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -1560,14 +1560,6 @@ cleaning up all windows currently displaying the buffer to be killed. */) | |||
| 1560 | if (EQ (buffer, XWINDOW (minibuf_window)->buffer)) | 1560 | if (EQ (buffer, XWINDOW (minibuf_window)->buffer)) |
| 1561 | return Qnil; | 1561 | return Qnil; |
| 1562 | 1562 | ||
| 1563 | /* Notify our base buffer that we don't share the text anymore. */ | ||
| 1564 | if (b->base_buffer) | ||
| 1565 | { | ||
| 1566 | eassert (b->indirections == -1); | ||
| 1567 | b->base_buffer->indirections--; | ||
| 1568 | eassert (b->base_buffer->indirections >= 0); | ||
| 1569 | } | ||
| 1570 | |||
| 1571 | /* When we kill an ordinary buffer which shares it's buffer text | 1563 | /* When we kill an ordinary buffer which shares it's buffer text |
| 1572 | with indirect buffer(s), we must kill indirect buffer(s) too. | 1564 | with indirect buffer(s), we must kill indirect buffer(s) too. |
| 1573 | We do it at this stage so nothing terrible happens if they | 1565 | We do it at this stage so nothing terrible happens if they |
| @@ -1708,7 +1700,15 @@ cleaning up all windows currently displaying the buffer to be killed. */) | |||
| 1708 | BVAR (b, name) = Qnil; | 1700 | BVAR (b, name) = Qnil; |
| 1709 | 1701 | ||
| 1710 | BLOCK_INPUT; | 1702 | BLOCK_INPUT; |
| 1711 | if (! b->base_buffer) | 1703 | if (b->base_buffer) |
| 1704 | { | ||
| 1705 | /* Notify our base buffer that we don't share the text anymore. */ | ||
| 1706 | eassert (b->indirections == -1); | ||
| 1707 | b->base_buffer->indirections--; | ||
| 1708 | eassert (b->base_buffer->indirections >= 0); | ||
| 1709 | } | ||
| 1710 | else | ||
| 1711 | /* No one shares our buffer text, can free it. */ | ||
| 1712 | free_buffer_text (b); | 1712 | free_buffer_text (b); |
| 1713 | 1713 | ||
| 1714 | if (b->newline_cache) | 1714 | if (b->newline_cache) |
| @@ -4897,6 +4897,9 @@ init_buffer_once (void) | |||
| 4897 | /* Prevent GC from getting confused. */ | 4897 | /* Prevent GC from getting confused. */ |
| 4898 | buffer_defaults.text = &buffer_defaults.own_text; | 4898 | buffer_defaults.text = &buffer_defaults.own_text; |
| 4899 | buffer_local_symbols.text = &buffer_local_symbols.own_text; | 4899 | buffer_local_symbols.text = &buffer_local_symbols.own_text; |
| 4900 | /* No one will share the text with these buffers, but let's play it safe. */ | ||
| 4901 | buffer_defaults.indirections = 0; | ||
| 4902 | buffer_local_symbols.indirections = 0; | ||
| 4900 | BUF_INTERVALS (&buffer_defaults) = 0; | 4903 | BUF_INTERVALS (&buffer_defaults) = 0; |
| 4901 | BUF_INTERVALS (&buffer_local_symbols) = 0; | 4904 | BUF_INTERVALS (&buffer_local_symbols) = 0; |
| 4902 | XSETPVECTYPESIZE (&buffer_defaults, PVEC_BUFFER, pvecsize); | 4905 | XSETPVECTYPESIZE (&buffer_defaults, PVEC_BUFFER, pvecsize); |