]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - console.c
the beginnings of a cgGL rendering path experiment, does not work yet
[xonotic/darkplaces.git] / console.c
index 2798199bcdf112020c086670a52a4416873532a9..71a5f86928ccea41619a75c690db6287bb0eea85 100644 (file)
--- a/console.c
+++ b/console.c
@@ -92,6 +92,7 @@ char rcon_redirect_buffer[1400];
 
 void ConBuffer_Init(conbuffer_t *buf, int textsize, int maxlines, mempool_t *mempool)
 {
+       buf->active = true;
        buf->textsize = textsize;
        buf->text = (char *) Mem_Alloc(mempool, textsize);
        buf->maxlines = maxlines;
@@ -117,6 +118,7 @@ ConBuffer_Shutdown
 */
 void ConBuffer_Shutdown(conbuffer_t *buf)
 {
+       buf->active = false;
        Mem_Free(buf->text);
        Mem_Free(buf->lines);
        buf->text = NULL;
@@ -227,6 +229,10 @@ void ConBuffer_AddLine(conbuffer_t *buf, const char *line, int len, int mask)
        char *putpos;
        con_lineinfo_t *p;
 
+       // developer_memory 1 during shutdown prints while conbuffer_t is being freed
+       if (!buf->active)
+               return;
+
        ConBuffer_FixTimes(buf);
 
        if(len >= buf->textsize)